This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: STM32 hal_start_clocks


Alan Bowman <alan.michael.bowman@gmail.com> writes:

> I've been trying to familiarise myself with the STM32 HAL, with a view
> to trying to get something (anything!) running on the STM32-Discovery
> board that was mentioned here a little while ago.  (If anyone's got
> anywhere with that, I'd be interested to hear.)
> 
> I noticed in hal_start_clocks() (line 169 in
> http://hg-pub.ecoscentric.com/ecos/file/b97a185587c7/packages/hal/cortexm/stm32/var/current/src/stm32_misc.c)
> that there seems to be an erroneous attempt to clear some bits.  I
> assume that there's a missing bit-inversion supposed to be applied to
> the AND operation, causing the two listed bits to be cleared.  I have
> no working hardware to test that assertion, but from reading the
> datasheet it looks like those bits are supposed to be explicitly
> cleared prior to an attempt to cleanly start HSE.
> 
> Can anyone confirm that this is the case?  Is there a missing ~ sign?

Yes, it looks like you are right, there ought to be a ~ in
there. Actually a ~(...) to bind the inversion properly.

However, I don't think at present it makes any difference since the
register is cleared to 0x00000001 just before.

Strictly this code is redundant, except as a way to get the initial
value of cr. However, if in the future we want to support dynamic
clock configuration, this code will be useful. So it is probably best
if it stays.

I'll check in a fix for this.


-- 
Nick Garnett                                      eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com      The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.     Tel: +44 1223 245571
Registered in England and Wales:                        Reg No: 4422071


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]