<?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>Processor Expert SoftwareのトピックRe: Re: Problem with generated CAN_LDD driver code for FlexCAN</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312814#M2354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ported my K60-based application from CW 10.4 + MQX 4.0.2.2 to KDS 1.1.1 + MQX 4.1.1.&lt;/P&gt;&lt;P&gt;My BSP is based on PEx and my application use both FlexCAN channels. For each of them I use a CAN_LDD driver.&lt;/P&gt;&lt;P&gt;I see that in KDS PEx the SendFrame function is already updated in the generated code. But my test code on both channels does not work any more.&lt;/P&gt;&lt;P&gt;The generated CAN_LDD driver code differs from my previous I got with CW 10.4 essentially on the SendFrame function (the FlexCAN peripheral is initialized in the same mode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach my test code and the ProcessorExpert project of my BSP.&lt;/P&gt;&lt;P&gt;On my board one CAN channel port is connected with the other CAN channel port and my code does the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Init CAN_LDD driver on both channels in the same mode.&lt;/LI&gt;&lt;LI&gt;Send a packet from the first CAN port and, after 300 msec, check its reception on the second CAN port.&lt;/LI&gt;&lt;LI&gt;Send a packet from the second CAN port and, after 300 msec, check its reception on the first CAN port.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my firmware compiled with CodeWarrior the test result is ok (so my hardware is good).&lt;/P&gt;&lt;P&gt;The test fails with my new firmware compiled with KDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some notes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;All the other function of my KDS firmware are working properly (serial ports, ADC, SPI, USB, etc.) as with my CW firmware. So I can say my BSP library is good.&lt;/LI&gt;&lt;LI&gt;I tried to incremet up to 2 sec the reception waiting time, but this does not fix the issue.&lt;/LI&gt;&lt;LI&gt;All the CAN_LDD driver functions return without errors (except when ReadFrame returns ERR_RXEMPTY).&lt;/LI&gt;&lt;LI&gt;With my scope I see that no packet is output from both the CAN channels when I call the SendFrame function.&lt;/LI&gt;&lt;LI&gt;My test passes only if I execute my application with the debugger and with a breakpoint set at the following line of the SendFrame function (in both drivers):&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CAN_PDD_SetMessageBufferCode(CAN1_BASE_PTR, BufferIdx, TxMBCode); /* Set code for Tx buffer of the message */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;How can the debugger breakpoint unblock the frame transmission on the CAN driver?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you help me to fix this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Nov 2014 16:39:48 GMT</pubDate>
    <dc:creator>Vagni</dc:creator>
    <dc:date>2014-11-07T16:39:48Z</dc:date>
    <item>
      <title>Problem with generated CAN_LDD driver code for FlexCAN</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312811#M2351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I look at the generated code for sending a frame, I wonder whether there is a race condition in it. &lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13969761635747277" jivemacro_uid="_13969761635747277" modifiedtitle="true"&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #006141;"&gt;uint32_t&lt;/SPAN&gt; StatusReg = CAN_PDD_GetStatusInterruptFlags1(CAN0_BASE_PTR); &lt;SPAN style="color: #4e9072;"&gt;/* Read content of the status register */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; line-height: 12pt;"&gt;&amp;nbsp; .... // other error checks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;&amp;nbsp; if&lt;/STRONG&gt;&lt;/SPAN&gt; ((StatusReg &amp;amp; (CAN_PDD_RECEIVING_MESSAGE | CAN_PDD_TRANSMITTING_MESSAGE)) != 0x00U) {&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt; ERR_BUSY;&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; &lt;SPAN style="color: #4e9072;"&gt;/* If yes then error */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #4e9072;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;/* {MQXLite RTOS Adapter} Critical section begin (RTOS function call is defined by MQXLite RTOS Adapter property) */&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; _int_disable();&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; CAN_PDD_SetMessageBufferCode(CAN0_BASE_PTR, BufferIdx, CAN_PDD_MB_TX_NOT_ACTIVE); &lt;SPAN style="color: #4e9072;"&gt;/* Set TX Buffer Inactive */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; .... /// Filling the buffer&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10px; line-height: 12pt;"&gt;&amp;nbsp; CAN_PDD_SetMessageBufferCode(CAN0_BASE_PTR, BufferIdx, TxMBCode); &lt;/SPAN&gt;&lt;SPAN style="font-size: 10px; line-height: 12pt; color: #4e9072;"&gt;/* Set code for &lt;/SPAN&gt;&lt;SPAN style="font-size: 10px; line-height: 12pt; text-decoration: underline; color: #4e9072;"&gt;Tx&lt;/SPAN&gt;&lt;SPAN style="font-size: 10px; line-height: 12pt; color: #4e9072;"&gt; buffer of the message */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #4e9072;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;/* {MQXLite RTOS Adapter} Critical section ends (RTOS function call is defined by MQXLite RTOS Adapter property) */&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; _int_enable();&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt; ERR_OK;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the following problems with it:&lt;/P&gt;&lt;P&gt;a) the code can be interrupted in any place between lines 1 and 7, meaning that with a sufficiently long delay the message buffer will be updated while the module is active.&lt;/P&gt;&lt;P&gt;b) the code checks the global activity flag, instead of checking the buffer to be updated. With a high load on the CAN bus, this will lead to extra delays.&lt;/P&gt;&lt;P&gt;c) the code disables interrupts while it updates the buffer content. Is this really necessary given that FlexCAN will not touch buffers marked as inactive?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would this at least be correct?&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13969794356514280" jivemacro_uid="_13969794356514280" modifiedtitle="true"&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #006141;"&gt;&amp;nbsp; uint32_t&lt;/SPAN&gt; StatusReg;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;&amp;nbsp; .... // other error checks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #4e9072; font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10px;"&gt;&amp;nbsp; _int_disable();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; line-height: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: 'Courier New'; font-size: 11px;"&gt;StatusReg = CAN_PDD_GetStatusInterruptFlags1( CAN0_BASE_PTR);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;&amp;nbsp; if&lt;/STRONG&gt;&lt;/SPAN&gt; ((StatusReg &amp;amp; (CAN_PDD_RECEIVING_MESSAGE | CAN_PDD_TRANSMITTING_MESSAGE)) != 0x00U) {&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _int_enable();&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt; ERR_BUSY;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P style="color: #4e9072; font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10px; line-height: 12pt;"&gt;&amp;nbsp; CAN_PDD_SetMessageBufferCode( CAN0_BASE_PTR, BufferIdx, CAN_PDD_MB_TX_NOT_ACTIVE); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; _int_enable();&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; .... // Fill the buffer&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; C&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: 'Courier New'; font-size: 11px;"&gt;AN_PDD_SetMessageBufferCode( CAN0_BASE_PTR, BufferIdx, TxMBCode);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; return ERR_OK;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still wonder whether the delay between checking the CAN activity and updating the buffer code is guaranteed to be short enough to not cause any interference. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 18:17:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312811#M2351</guid>
      <dc:creator>Laartoor</dc:creator>
      <dc:date>2014-04-08T18:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with generated CAN_LDD driver code for FlexCAN</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312812#M2352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have received the following comments from our development team:&lt;/P&gt;&lt;P&gt;&lt;EM style="line-height: 1.5em;"&gt;&lt;STRONG&gt;ad &lt;SPAN style="font-size: 9.5pt; font-family: Helvetica, sans-serif; color: #3d3d3d;"&gt;a)&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.5pt; font-family: Helvetica, sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;the code can be interrupted in any place between lines 1 and 7, meaning that with a sufficiently long delay the message buffer will be updated while the module is active.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;Yes, we confirm this issue, the state checking of CAN device is not in critical section, which provides a place for possible HW state change before message buffer starts to be filled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&lt;STRONG&gt;ad b) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&lt;STRONG&gt;the code checks the global activity flag, instead of checking the buffer to be updated. With a high load on the CAN bus, this will lead to extra delays.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;Yes, you are also right in this point. We are changing this to check the state of each TX buffer individually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 9.5pt; font-family: 'Helvetica','sans-serif';"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 9.5pt; font-family: 'Helvetica','sans-serif';"&gt;&lt;STRONG&gt;ad c) &lt;/STRONG&gt;&lt;/EM&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 9.5pt; font-family: 'Helvetica','sans-serif';"&gt; &lt;/STRONG&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&lt;STRONG&gt;the code checks the global activity flag, instead of checking the buffer to be updated. With a high load on the CAN bus, this will lead to extra delays.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;We think if should be in "critical section". It could happen that filling of message buffer is interrupted by some event code, which could fill data into the buffer and after returning, the same message buffer would be overwritten. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;The points a) and b) are fixed for next update of Processor Expert Driver Suite 10.4 and CodeWarrior 10.6.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;As an immediate workaround, please follow these steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;1) Configure the CAN component according to your needs&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;2) In the pop-up menu of the CAN_LDD component select the option Code Generation &amp;gt; Don't Write Generated Component Modules&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;3) int the same pop-up menu select Open File &amp;gt; Generated_code/Can1.c (or what is your name of c file of the CAN component) and open this file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Helvetica','sans-serif'; color: #3d3d3d;"&gt;4) Replace the content of the SendFrame function with the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13987725717354657" jivemacro_uid="_13987725717354657"&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;LDD_TError CAN1_SendFrame(LDD_TDeviceData *DeviceDataPtr, LDD_CAN_TMBIndex BufferIdx, LDD_CAN_TFrame *Frame) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;{ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; CAN1_TDeviceData *DeviceDataPrv = (CAN1_TDeviceData *)DeviceDataPtr; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; LDD_CAN_TBufferMask BufferMask;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Bitmask of the requested message buffer */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; uint8_t TxMBCode = 0x00U;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Temporary value of MB code */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; uint8_t DataIndex; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if (BufferIdx &amp;gt; DeviceDataPrv-&amp;gt;MaxBufferIndex) { /* Is BufferIdx greater than MaxBuffers? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERR_PARAM_RANGE;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If yes then error */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; BufferMask = (LDD_CAN_TBufferMask)(0x01UL &amp;lt;&amp;lt; BufferIdx); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if ((BufferMask &amp;amp; DeviceDataPrv-&amp;gt;TxBufferMask) == 0x00U) { /* Is used buffer defined of BufferIdx for transmit? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERR_PARAM_INDEX;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If no then error */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if (Frame-&amp;gt;Length &amp;gt; DeviceDataPrv-&amp;gt;MaxDataLen) { /* Is number of data greater than MaxDataLen? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERR_PARAM_LENGTH;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If yes then error */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if (Frame-&amp;gt;FrameType &amp;gt; LDD_CAN_RESPONSE_FRAME) { /* Is FrameType other than LDD_CAN_DATA_FRAME_STD, LDD_CAN_DATA_FRAME_EXT or LDD_CAN_REMOTE_FRAME? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERR_PARAM_ATTRIBUTE_SET;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If yes then error */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; /* {Default RTOS Adapter} Critical section begin, general PE function is used */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; _int_disable(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if (CAN_PDD_GetMessageBufferCode(CAN0_BASE_PTR, BufferIdx) != CAN_PDD_MB_TX_NOT_ACTIVE) { /* Is Tx buffer inactive */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* {Default RTOS Adapter} Critical section end, general PE function is used */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _int_enable(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERR_BUSY;&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; /* If no then error */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if ((Frame-&amp;gt;MessageID &amp;amp; LDD_CAN_MESSAGE_ID_EXT) != 0x00U) { /* Is the frame configured as Extended ID? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_SetMessageBufferID(CAN0_BASE_PTR, BufferIdx, CAN_PDD_BUFFER_ID_EXT, (Frame-&amp;gt;MessageID)&amp;amp;~(LDD_CAN_MESSAGE_ID_EXT)); /*Assign extended ID to buffer */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferIDExt(CAN0_BASE_PTR, BufferIdx, PDD_ENABLE); /*Set ID extended */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } else { &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_SetMessageBufferID(CAN0_BASE_PTR, BufferIdx, CAN_PDD_BUFFER_ID_STD, Frame-&amp;gt;MessageID); /*Assign Standard ID to buffer */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferIDExt(CAN0_BASE_PTR, BufferIdx, PDD_DISABLE); /*Set ID standard */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; if ((Frame-&amp;gt;FrameType == LDD_CAN_DATA_FRAME)||(Frame-&amp;gt;FrameType == LDD_CAN_RESPONSE_FRAME)) { /* Is it a data or WaitOnRemote frame? */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (DataIndex = 0x00U; DataIndex &amp;lt; Frame-&amp;gt;Length; DataIndex++) { /* Fill message buffer data array */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_SetMessageBufferData(CAN0_BASE_PTR, BufferIdx, DataIndex, Frame-&amp;gt;Data[DataIndex]); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_SetMessageBufferDataLength(CAN0_BASE_PTR, BufferIdx, Frame-&amp;gt;Length); /* Set the length of the message */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferRTR(CAN0_BASE_PTR, BufferIdx, PDD_DISABLE); /* Clear RTR bit */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferSRR(CAN0_BASE_PTR, BufferIdx, PDD_DISABLE); /* Clear SRR bit */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Frame-&amp;gt;FrameType == LDD_CAN_DATA_FRAME) { &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TxMBCode = CAN_PDD_MB_TX_DATA_FRAME; /* Set buffer as a transmit buffer */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TxMBCode = CAN_PDD_MB_TX_RESPONSE_FRAME; /* Set buffer as a response transmit buffer for remote frames */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } else {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Remote frame */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TxMBCode = CAN_PDD_MB_TX_REMOTE_FRAME; /* Set Tx buffer for remote frames */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_SetMessageBufferDataLength(CAN0_BASE_PTR, BufferIdx, 0x00U); /* Set the length of the message */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferRTR(CAN0_BASE_PTR, BufferIdx, PDD_ENABLE); /* Set the message as a remote frame */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((Frame-&amp;gt;MessageID &amp;amp; LDD_CAN_MESSAGE_ID_EXT) != 0x00U) { /* Extended frame */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferSRR(CAN0_BASE_PTR, BufferIdx, PDD_ENABLE); /* Set SRR bit */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&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;&amp;nbsp; /* Standard frame */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_PDD_EnableMessageBufferSRR(CAN0_BASE_PTR, BufferIdx, PDD_DISABLE); /* Clear SRR bit */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; CAN_PDD_SetMessageBufferCode(CAN0_BASE_PTR, BufferIdx, TxMBCode); /* Set code for Tx buffer of the message */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; /* {Default RTOS Adapter} Critical section end, general PE function is used */ &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; _int_enable(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;&amp;nbsp; return ERR_OK; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial; font-size: 11px; background-color: #f6f6f6;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 11:57:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312812#M2352</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2014-04-29T11:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with generated CAN_LDD driver code for FlexCAN</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312813#M2353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response. I see your point about keeping the lock longer, it ensures correctness if you are using multiple threads to update one buffer, and given that the update will take only a couple dozens of cycles, the performance benefit would not be worth it to complicate the interface.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2014 17:27:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312813#M2353</guid>
      <dc:creator>Laartoor</dc:creator>
      <dc:date>2014-05-01T17:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Problem with generated CAN_LDD driver code for FlexCAN</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312814#M2354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ported my K60-based application from CW 10.4 + MQX 4.0.2.2 to KDS 1.1.1 + MQX 4.1.1.&lt;/P&gt;&lt;P&gt;My BSP is based on PEx and my application use both FlexCAN channels. For each of them I use a CAN_LDD driver.&lt;/P&gt;&lt;P&gt;I see that in KDS PEx the SendFrame function is already updated in the generated code. But my test code on both channels does not work any more.&lt;/P&gt;&lt;P&gt;The generated CAN_LDD driver code differs from my previous I got with CW 10.4 essentially on the SendFrame function (the FlexCAN peripheral is initialized in the same mode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach my test code and the ProcessorExpert project of my BSP.&lt;/P&gt;&lt;P&gt;On my board one CAN channel port is connected with the other CAN channel port and my code does the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Init CAN_LDD driver on both channels in the same mode.&lt;/LI&gt;&lt;LI&gt;Send a packet from the first CAN port and, after 300 msec, check its reception on the second CAN port.&lt;/LI&gt;&lt;LI&gt;Send a packet from the second CAN port and, after 300 msec, check its reception on the first CAN port.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my firmware compiled with CodeWarrior the test result is ok (so my hardware is good).&lt;/P&gt;&lt;P&gt;The test fails with my new firmware compiled with KDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some notes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;All the other function of my KDS firmware are working properly (serial ports, ADC, SPI, USB, etc.) as with my CW firmware. So I can say my BSP library is good.&lt;/LI&gt;&lt;LI&gt;I tried to incremet up to 2 sec the reception waiting time, but this does not fix the issue.&lt;/LI&gt;&lt;LI&gt;All the CAN_LDD driver functions return without errors (except when ReadFrame returns ERR_RXEMPTY).&lt;/LI&gt;&lt;LI&gt;With my scope I see that no packet is output from both the CAN channels when I call the SendFrame function.&lt;/LI&gt;&lt;LI&gt;My test passes only if I execute my application with the debugger and with a breakpoint set at the following line of the SendFrame function (in both drivers):&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CAN_PDD_SetMessageBufferCode(CAN1_BASE_PTR, BufferIdx, TxMBCode); /* Set code for Tx buffer of the message */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;How can the debugger breakpoint unblock the frame transmission on the CAN driver?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you help me to fix this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 16:39:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Problem-with-generated-CAN-LDD-driver-code-for-FlexCAN/m-p/312814#M2354</guid>
      <dc:creator>Vagni</dc:creator>
      <dc:date>2014-11-07T16:39:48Z</dc:date>
    </item>
  </channel>
</rss>

