<?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 Keil v4.60 and lpc18xx libraries in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525689#M8325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Cusko on Mon Oct 08 07:13:34 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just for information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had some problems with an USART on my board with the LPC1820. After 2 days I found bug with the new version of Keil compiler. In the file Lpc18xx_cgu.c in line 637 there is condition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ( if((CGU_PERIPHERAL_Info[Clock].PerBranchOffset!= 0) &amp;amp;&amp;amp; !(CGU_PER_BRANCH_STATUS(Clock) &amp;amp; CGU_BRANCH_STATUS_ENABLE_MASK)) return 0; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;that is&amp;nbsp; not evaluated correctly in the last Keil uVision v4.60. So USART only works when you comment this line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably there is more of these bugs with the new version of Keil compiler. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:16:14 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:16:14Z</dc:date>
    <item>
      <title>Keil v4.60 and lpc18xx libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525689#M8325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Cusko on Mon Oct 08 07:13:34 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just for information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had some problems with an USART on my board with the LPC1820. After 2 days I found bug with the new version of Keil compiler. In the file Lpc18xx_cgu.c in line 637 there is condition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ( if((CGU_PERIPHERAL_Info[Clock].PerBranchOffset!= 0) &amp;amp;&amp;amp; !(CGU_PER_BRANCH_STATUS(Clock) &amp;amp; CGU_BRANCH_STATUS_ENABLE_MASK)) return 0; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;that is&amp;nbsp; not evaluated correctly in the last Keil uVision v4.60. So USART only works when you comment this line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably there is more of these bugs with the new version of Keil compiler. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:16:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525689#M8325</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Keil v4.60 and lpc18xx libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525690#M8326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by diederichs on Mon Oct 15 14:19:40 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;We just had the same issue developing on the LPC4350 using Keil 4.60.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if((CGU_PERIPHERAL_Info[Clock].PerBranchOffset!= 0) &amp;amp;&amp;amp; !(CGU_PER_BRANCH_STATUS(Clock) &amp;amp; CGU_BRANCH_STATUS_ENABLE_MASK)) return 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;located in CGU_GetPCLKFrequency() now evaluates true and causes a returned value of 0 Hz.&amp;nbsp; Commenting this line "corrects" the function of the routine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have confirmed (with our revision control system) that there has been no change to the LPCware routines or our firmware.&amp;nbsp; Only the compiler was modified in the update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are stumped as to what is causing this.&amp;nbsp; Anyone have some thoughts apart from compiler bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:16:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525690#M8326</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Keil v4.60 and lpc18xx libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525691#M8327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Cusko on Mon Oct 22 01:40:09 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I also find out that with an ADC there is a problem few lines below with line 642 : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if((CGU_PERIPHERAL_Info[Clock].RegBranchOffset!= 0) &amp;amp;&amp;amp; !(CGU_REG_BRANCH_STATUS(Clock) &amp;amp; CGU_BRANCH_STATUS_ENABLE_MASK)) return 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with the Keil support team on this problem, so when I will have any answers I will let you know. Till then just comment those lines.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:16:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525691#M8327</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Keil v4.60 and lpc18xx libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525692#M8328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alindvall on Fri Nov 16 00:40:47 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen the same problem on LPC4357 on 4.60. I talked to Keil's support and got the following answer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your information, the problem was in the lpc43xx_cgu.c file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(CGU_REG_BRANCH_STATUS(Clock) &amp;amp; CGU_BRANCH_STATUS_ENABLE_MASK)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in case of armcc CGU_BRANCH_STATUS_ENABLE_MASK is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CGU_BRANCH_STATUS_ENABLE_MASK&amp;nbsp; 0x01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and CGU_REG_BRANCH_STATUS is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CGU_REG_BRANCH_STATUS(x) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(*(uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].RegBranchOffset+0))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like, because CGU_REG_BRANCH_STATUS(Clock) is not volatile, compiler loads only a byte &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from this address, which is ok, as only 8 bit get tested. Other bits don't care.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But this address is in SFR space and byte access might be a problem, so wrong data is loaded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To fix this, make CGU_REG_BRANCH_STATUS(Clock) dereferencing a volatile address:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CGU_REG_BRANCH_STATUS(x) (*(volatile &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].RegBranchOffset+0))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;----------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When applying the fix to the CGU_REG_BRANCH_STATUS define I found that I had to do the same with the CGU_PER_BRANCH_STATUS define. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:16:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525692#M8328</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Keil v4.60 and lpc18xx libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525693#M8329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Cusko on Mon Nov 19 06:25:16 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I got the same answer today. So NXP, fix the bug for the next release!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FIX:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CGU_REG_BRANCH_STATUS(x) (*(volatile uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].RegBranchOffset+4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CGU_PER_BRANCH_STATUS(x) (*(volatile uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].PerBranchOffset+4))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:16:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Keil-v4-60-and-lpc18xx-libraries/m-p/525693#M8329</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:16:17Z</dc:date>
    </item>
  </channel>
</rss>

