Target startup code - Where is PLLCFG_VAL defined?
Hello,
I'm new to CrossWorks and I'm using Release 1.7 Build 6. My target is an ARM7 NXP LPC2368.
I was looking at the code that is automatically added to a project for a given target (those files inside System Files) and I noticed that in the reset_handler (in file Philips_LPC230X_Startup.s) there is some code which configures the PLL. This code is validated against the definition of PLLCFG_VAL and NO_PLL_ENABLE not being defined and even though I haven't added any preprocessor definition the code s being executed which means that it has to be defined somewhere but I just can't find it.
Can anyone tell me were is PLLCFG_VAL defined? I mean, I know I can override it but I'm just trying to know CrossWorks better in order to be aware of its tricks, hidden definitions, etc.
Here's the code section that starts the PLL configuration:
/******************************************************************************
* *
* Default exception handlers *
* *
******************************************************************************/
reset_handler:
ldr r0, =SCB_BASE
#if defined(PLLCFG_VAL) && !defined(NO_PLL_ENABLE)
/* Configure PLL Multiplier/Divider */
ldr r1, [r0, #PLLSTAT_OFFSET]
tst r1, #PLLSTAT_PLLC
beq 1f
/* Disconnect PLL */
ldr r1, =PLLCON_PLLE
str r1, [r0, #PLLCON_OFFSET]
mov r1, #0xAA
str r1, [r0, #PLLFEED_OFFSET]
mov r1, #0x55
str r1, [r0, #PLLFEED_OFFSET]
Thanks in advance!
Chalo
-
Hi there is a configuration file in which these variables are yet defined ?I should set the multiplier and divider value, the USB clock value and sets the peripheral clock different for some of them. I made a search in order to see where the variables are yet defined, but nothing. Can I define them in a file and include it in the project ?How can I check that the defined values are effectively setted ?
best regards
-
PLLCFG_VAL, CCLKCFG_VAL and USBCLKCFG_VAL are defined at the top of the Philips_LPC230X_Startup.s file if OSCILLATOR_CLOCK_FREQUENCY is 12000000.
If you are using a different input clock frequency or want to override the default values you can do this using the Preprocessor Options > Preprocessor Definitions project property.
You can check the defined values are set to the value you want by building the program and looking at the disassembly of the code. You could also run the program and check the value of the register using the memory or register window.
-
I have defined in the project properties the preprocessor options:
PLLCFG_VAL 0x0002001F
when I recompile the result is "error: garbage following instruction --ldr r1,=0x0002001F1"
how is the sintax ? At which manual pèage I will find it ? Did you have some examples ?
I apologize for the bunch of questions, but I'm new to crossworks, we are evaluation it (up now we used free keil) in order to buy.
best regards
Please sign in to leave a comment.
Comments
7 comments