public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] STM32 hal_start_clocks
@ 2011-01-12 21:45 Alan Bowman
  2011-01-13 11:32 ` Nick Garnett
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Bowman @ 2011-01-12 21:45 UTC (permalink / raw)
  To: ecos-discuss

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?

Cheers

Alan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] STM32 hal_start_clocks
  2011-01-12 21:45 [ECOS] STM32 hal_start_clocks Alan Bowman
@ 2011-01-13 11:32 ` Nick Garnett
  2011-01-14 11:53   ` Alan Bowman
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Garnett @ 2011-01-13 11:32 UTC (permalink / raw)
  To: Alan Bowman; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] STM32 hal_start_clocks
  2011-01-13 11:32 ` Nick Garnett
@ 2011-01-14 11:53   ` Alan Bowman
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Bowman @ 2011-01-14 11:53 UTC (permalink / raw)
  To: ecos-discuss

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

I thought so, but there's some bits in that register that are also
hardware controlled that I was uncertain about.

> I'll check in a fix for this.

Thanks very much.

Alan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-14 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 21:45 [ECOS] STM32 hal_start_clocks Alan Bowman
2011-01-13 11:32 ` Nick Garnett
2011-01-14 11:53   ` Alan Bowman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).