2017-08-20 12:37 PM
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.
2017-08-21 06:15 AM
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.
2017-08-21 07:10 AM
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.
2017-08-21 08:36 AM
A blinking LED works with the other clock settings?
JW
2017-08-22 02:58 AM
Solved. Thanks a lot for parttaking! There was a PCB mounting error.