Skip to main content
Associate
October 5, 2024
Solved

SPI4 on stm32mp157f-dk2 SCLK won't run faster than 16MHz

  • October 5, 2024
  • 1 reply
  • 1242 views

Hi, I am trying to run spidev on the stm32mp157f-dk2 using python and I have set my SPI4 max frequency above 40MHz, but I can't seem to run it more than 16MHz. I have checked the clock tree configurations and the device tree configuration; I seem to have set everything correctly but I can't seem to run it faster. 

 

Acekiller007_0-1728087033832.png

Acekiller007_1-1728087147855.pngAcekiller007_2-1728087166162.png

 

 

Best answer by Andrew Neil

Please see the Posting Tips for how to properly post source code - not as images:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 


@Acekiller007 wrote:

 I can't seem to run it more than 16MHz.


So what does happen when you try >16MHz ?

Do you get an error? Does it just stick at 16MHz? Or what?

Does the Python documentation state any limitations?

1 reply

Andrew Neil
Andrew NeilBest answer
Super User
October 7, 2024

Please see the Posting Tips for how to properly post source code - not as images:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 


@Acekiller007 wrote:

 I can't seem to run it more than 16MHz.


So what does happen when you try >16MHz ?

Do you get an error? Does it just stick at 16MHz? Or what?

Does the Python documentation state any limitations?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
October 7, 2024

Hello Andrew! Thank you for the guidelines. 

Regarding the issue, I do not get any specific error message I just cannot seem to measure the Frequency above 16MHz even though I try to run SPI4 at 40MHz or more. I'm not sure if the python documentation states any limitations and it should be able to run more than 16MHz but if I try to run at 40MHz, my code works but I cannot see the equivalent frequency of the clock when I measure it.