<?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: LPC11Uxx set_pll error</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536284#M4993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by steven_ece on Sun May 27 15:07:42 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I would gives this one more look. I checked back here and still nothing from the support staff. It looks like LPC11Uxx User Manual rev. 2.1 and example code contains an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the previous code at the top of this thread the line below should have concerned anyone who has got set_pll to work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ROM **rom = (ROM **)(0x1FFF1FF8 + (3 * sizeof(ROM**)));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead it should be &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ROM **rom = (ROM **)0x1FFF1FF8;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This error is on page 53. I also saw it in some example code somewhere. I don't remember where it is. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I get a chance I will post a link to the project I used to test this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:22:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:22:59Z</dc:date>
    <item>
      <title>LPC11Uxx set_pll error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536282#M4991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by steven_ece on Wed May 23 10:43:39 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: 5/25/2012 I have tracked the problem down to this. I checked the stack frame to see the last PC and then reset the system and stepped to that instruction which is ldr r3, [r3, #0] and r3 = 0x78C04821. In the ARM CORTEX M0 Generic User Guide this address should be external ram, none that I am aware of! Also I am not able to view anything at this location in the IDE. I checked the pointer into the boot rom and that was correct, so why am I getting here? Has anybody else experienced this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Teh following is the code I am using on the LPC11u14. I wanted to see how set_pll worked so I am calling it in clockOpen and end up in the fault handler. I stepped through the disassembly and the fault happens after several load instructions. Any ideas on what I am missing?&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;

/*
 * powerProfiles.c
 *
 *&amp;nbsp; Created on: May 21, 2012
 *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: surrender
 */

#include "LPC11Uxx.h"


#define CLKOUT 1

// set_pll mode options
#define CPU_FREQ_EQU 0
#define CPU_FREQ_LTE 1
#define CPU_FREQ_GTE 2
#define CPU_FREQ_APPROX 3
// set_pll result0 options
#define PLL_CMD_SUCCESS 0
#define PLL_INVALID_FREQ 1
#define PLL_INVALID_MODE 2
#define PLL_FREQ_NOT_FOUND 3
#define PLL_NOT_LOCKED 4

typedef struct _PWRD{
void(*set_pll)(unsigned int cmd[], unsigned int resp[]);
void(*set_power)(unsigned int cmd[], unsigned int resp[]);
}PWRD;

typedef struct _ROM{
const PWRD *pPWRD;
}ROM;

ROM **rom = (ROM **)(0x1FFF1FF8 + (3 * sizeof(ROM**))); // &amp;lt;#! BUG FROM THE USER MANUAL - change to ROM **rom = (ROM **)0x1FFF1FF8 !#&amp;gt;
unsigned int command[4], result[2];

/*
 * ============================================================================
 * Function : - Sets the PLL source to system oscillator
 *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Sets the main clock source to the PLL input source
 *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Sets the system clock divider to 1
 * ============================================================================
 */
void ppInit( void ){
uint32_t i;
/* Power on main oscillator */
LPC_SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~(0x01&amp;lt;&amp;lt;5); /* Power on the system oscillator */
for(i = 0; i &amp;lt; 30000; i++); /* Wait for clock to stabalize */

/* Set PLL clock source to system oscillator */
LPC_SYSCON-&amp;gt;SYSPLLCLKSEL = 0x01; /* Set PLL clock source to system oscillator */
LPC_SYSCON-&amp;gt;SYSPLLCLKUEN = 0x00; /* Update clock source */
while(LPC_SYSCON-&amp;gt;SYSPLLCLKUEN); /* Wait for update */
LPC_SYSCON-&amp;gt;SYSPLLCLKUEN = 0x01; /* Update clock source */
while(!(LPC_SYSCON-&amp;gt;SYSPLLCLKUEN)); /* Wait for update */

/* Set main clock source to PLL input */
LPC_SYSCON-&amp;gt;MAINCLKSEL = 0x01; /* Set main clock source to PLL input */
LPC_SYSCON-&amp;gt;MAINCLKUEN = 0x00; /* Update clock source */
while(LPC_SYSCON-&amp;gt;MAINCLKUEN); /* Wait for update */
LPC_SYSCON-&amp;gt;MAINCLKUEN = 0x01; /* Update clock source */
while(!(LPC_SYSCON-&amp;gt;MAINCLKUEN)); /* Wait for update */

/* Set system clock divider defaults to 1 */

#if CLKOUT
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Output clock to io pin */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_IOCON-&amp;gt;PIO0_1 = 0x01; /* Enable clock out function on pin0_1 */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;CLKOUTSEL = 0x03; /* Main clock frequency */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;CLKOUTDIV = 24; /* Divide by 24 */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;CLKOUTUEN = 0x00;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while(LPC_SYSCON-&amp;gt;CLKOUTUEN &amp;amp; 0x01); /* Wait for update */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;CLKOUTUEN = 0x01;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(LPC_SYSCON-&amp;gt;CLKOUTUEN &amp;amp; 0x01)); /* Wait for update */
#endif /* CLKOUT */
}

void clockOpen( void ){
ppInit(); /* Initialize components for set_pll routine */
command[0] = 12000;
command[1] = 25000;
command[2] = CPU_FREQ_LTE;
command[3] = 0;
(*rom)-&amp;gt;pPWRD-&amp;gt;set_pll(command,result);
}

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:22:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536282#M4991</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11Uxx set_pll error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536283#M4992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by steven_ece on Sun May 27 09:13:38 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I will probably just write my own power management profiles, but I would like to know if I missed something about the ROM based APIs. At this point I am still getting to know my way around with this MCU.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are they supposed to be on an external RAM?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What did I miss in the setup in order for me to successfully use the APIs?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536283#M4992</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11Uxx set_pll error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536284#M4993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by steven_ece on Sun May 27 15:07:42 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I would gives this one more look. I checked back here and still nothing from the support staff. It looks like LPC11Uxx User Manual rev. 2.1 and example code contains an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the previous code at the top of this thread the line below should have concerned anyone who has got set_pll to work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ROM **rom = (ROM **)(0x1FFF1FF8 + (3 * sizeof(ROM**)));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead it should be &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ROM **rom = (ROM **)0x1FFF1FF8;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This error is on page 53. I also saw it in some example code somewhere. I don't remember where it is. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I get a chance I will post a link to the project I used to test this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC11Uxx-set-pll-error/m-p/536284#M4993</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:22:59Z</dc:date>
    </item>
  </channel>
</rss>

