cancel
Showing results for 
Search instead for 
Did you mean: 

HSERDY bit is always 0

iwaslohan
Associate
Posted on September 08, 2012 at 14:48

Hi guys,

I have a board from hardware guys who told me they had tested this board and everything is fine including SPI1. But I cannot let my SPI1 working because status register bit TXE is always 0. From the specification, this bit should be 0 at reset status. Then I went through the code and found function RCC_WaitForHSEStartUp() always returns ERROR. I checked the address 0x40021000, it was 0x10001.

We are using 8MHz external clock. Can anyone give me any clus that I can check to find the problem?

Thanks in advance.

David

#not-ready #not-oscillating #rcc
4 REPLIES 4
Posted on September 08, 2012 at 15:24

You have to start it, and it has to oscillate, for it to come ready.

Check it with a scope.

The part will start running from the 8 MHz (STM32F1) internal oscillator, and you should be able to test a lot of things running from the HSI, or at higher speed via the PLL.

If the SPI peripheral registers are stuck at zero, you might want to confirm the peripheral clock has been enabled.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
iwaslohan
Associate
Posted on September 09, 2012 at 14:49

Hi Clive1

Thanks for your reply.

I can see function RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE) has been called.  So it looks like the problem comes from the internal clock. I will use a scope to see I can find anything or not.

Thanks again.

Cheers,

jpeacock2399
Associate II
Posted on September 10, 2012 at 16:05

The 0x10001 status shows that the HSE oscillator is started but not running.  The usual problem with this is that the crystal and capacitors are not well matched to the oscillator requirements.  ST has an app note on selecting crystals and matching capacitors.  Look at app note AN2867.

  Jack Peacock

Posted on September 10, 2012 at 16:27

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00221665.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..