[PATCH] bsp/lm4f120: new BSP to support TI LM4F120 XL LaunchPad board

Karel Gardas karel.gardas at centrum.cz
Mon Aug 26 17:05:59 UTC 2013


On 08/25/13 10:26 PM, Eugeniy Meshcheryakov wrote:
> Hi,
>
> I had not time yet to find out how to make this patch work with my
> board, but there are some strange places in this patch.
>
> 20 серпня 2013 о 18:51 +0200 Karel Gardas написав(-ла):
>> +  lm3s69xx_syscon_delay_3x_clocks(524288);
> What is this large delay for? Where the number came from?

This comes from TI's StellarisWare SysCtlClockSet function. I've used 
that value since I've thought TI knows what they do (and what they don't 
correctly describe in spec.) and that's it's probably there for 
compatibility reason. The comment to this value claims that you need to 
give used oscillator a time to stabilize and more time is used for 
faster clock source. Anyway, the value is not needed for my board so if 
you don't like it I'm free to remove it.

>> +
>> +  rcc = (rcc&  ~(SYSCONRCC_XTAL_MSK))
>> +      | SYSCONRCC_XTAL(LM3S69XX_XTAL_CONFIG);
>> +  rcc2 = (rcc2&  ~(SYSCONRCC2_PWRDN2 | SYSCONRCC2_USERCC2 | SYSCONRCC2_OSCSRC2_MSK))
>> +      | SYSCONRCC2_USERCC2 | SYSCONRCC2_OSCSRC2_MSK;
> Why are you both resetting and later setting SYSCONRCC2_USERCC2 in this
> expression?

Indeed, this is not strictly necessary so I'll simplify this part.

> You do the same with SYSCONRCC2_OSCSRC2_MSK. Oring with
> SYSCONRCC2_OSCSRC2_MSK cannot be possibly correct, you should use some
> constant similar to SYSCONRCC_OSCSRC_IOSC. SYSCONRCC2_OSCSRC2_MSK = 7 in
> this field corresponds to 32 kHz oscillator that I dont have available
> on my board.

Indeed, that's a bug, but on the other hand coincidentally works. Anyway 
what I'd like to use is:

   rcc2 = (rcc2 & ~(SYSCONRCC2_PWRDN2 | SYSCONRCC2_OSCSRC2_MSK))
       | SYSCONRCC2_USERCC2 | SYSCONRCC2_OSCSRC2(0x0);

as I'd like to use main oscillator. Are you OK with that?

BTW, although you claim 32 kHz oscillaros is not available on your 
board, I've looked into both lm3s6965 and lm3s3749 and both provides 0x7 
value for 32.768 kHz external oscillator -- perhaps you've been looking 
in RCC paragraph instead of RCC2?

Thanks!
Karel



More information about the devel mailing list