cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f042f6 spi doesn't work with HSI as PLL source

EvgenS Po
Associate II
Posted on August 20, 2017 at 21:37

Hello! I'm using spi peripheral on STM32f042f6p6 and faced with strange situation: spi works only if system clock is PLL and HSE is PLL source. I have tried HSI, HSI48, with them spi does not work at all: neither transmission, nor reception. In all PLL source cases HSE, HSI, HSI48, the application code is the same and modified only to change system clock. I have found nothing about that issue in documentation.

So, is it normal for stm32f042f6? If it is, please give me some references for documentation.

If it is not, please help me find out what I'm missing.

Thanks in advance.

4 REPLIES 4
Posted on August 21, 2017 at 15:15

Can't say I've heard of such an issue, the SPI should derive it's clock from the APB which divides down from the AHB and CPU clock. Check there aren't other clock source options.

Show the system clock initialization, and peripheral initialization, ideally as a stand-alone demo.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
EvgenS Po
Associate II
Posted on August 21, 2017 at 16:10

Thanks for replies. The rest part of code works as it should, that is, everything except for spi functions properly with different clock settings. spi transfer hangs on Rxne flag checking. I'll provide demo project as Clive One suggested.

Posted on August 21, 2017 at 15:36

A blinking LED works with the other clock settings?

JW

EvgenS Po
Associate II
Posted on August 22, 2017 at 11:58

Solved. Thanks a lot for parttaking! There was a PCB mounting error.