Author Topic: STM32H SPI low lever transfer  (Read 1871 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1906
  • Country: ca
STM32H SPI low lever transfer
« on: August 06, 2020, 12:48:14 pm »
Hi,
I want to transfer 8bit data in Register mode, using STM32H,
here is my code snippet,

Quote
void SPIData8(int data){
SPI4->TXDR = data;
SPI4->CR2 = 1;
SPI4->CR1 = SPI_CR1_CSTART;
while(SPI4->SR & (SPI_SR_EOT));
}

But, this code does not work! any Ideas?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Online Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1674
  • Country: us
Re: STM32H SPI low lever transfer
« Reply #1 on: September 02, 2020, 03:52:50 am »
Please define “does not work”. We don’t have crystal balls...
Complexity is the number-one enemy of high-quality code.
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1906
  • Country: ca
Re: STM32H SPI low lever transfer
« Reply #2 on: September 02, 2020, 06:27:14 am »
Quote
Please define “does not work”. We don’t have crystal balls...
It does not make any SPI transaction :'(
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline Mecanix

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: cc
Re: STM32H SPI low lever transfer
« Reply #3 on: September 02, 2020, 10:11:38 am »
Need to see your main() and how you init the clock and spi modes. Have a look at the generic driver (stm32h7xx_ll_spi.h) and see if you haven't missed anything...
 

Online Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1674
  • Country: us
Re: STM32H SPI low lever transfer
« Reply #4 on: September 04, 2020, 06:26:05 am »
Yes, please show us all of your code.

The documentation for the SPI peripheral in the STM32H7 series is utter crap and reads like it was written by an eight year old for whom English is their fifth language.
Complexity is the number-one enemy of high-quality code.
 
The following users thanked this post: Siwastaja

Offline Mecanix

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: cc
Re: STM32H SPI low lever transfer
« Reply #5 on: September 04, 2020, 10:03:17 pm »
The documentation for the SPI peripheral in the STM32H7 series is utter crap and reads like it was written by an eight year old for whom English is their fifth language.

LL's #UM2217
https://www.st.com/resource/en/user_manual/dm00392525-description-of-stm32h7-hal-and-lowlayer-drivers-stmicroelectronics.pdf
 

Online Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1674
  • Country: us
Re: STM32H SPI low lever transfer
« Reply #6 on: September 07, 2020, 05:44:27 pm »
The documentation for the SPI peripheral in the STM32H7 series is utter crap and reads like it was written by an eight year old for whom English is their fifth language.

LL's #UM2217
https://www.st.com/resource/en/user_manual/dm00392525-description-of-stm32h7-hal-and-lowlayer-drivers-stmicroelectronics.pdf

That’s the documentation for the Hal and the LL drivers. I was referring to the description of the SPI peripheral in the STM32H7 Reference Manual. You know, the one that describes the operation of the peripheral at the register level?

Not everyone uses ST’s libraries—some of us write our own. Sometimes this is more difficult than it needs to be due to shitty documentation from the vendor. IMO, there’s no excuse for this. These documents should be written by a collaboration between technical writers and the engineers who designed the chip, and either the technical writer should be a native English speaker, or the entire document should be proofread by a native English speaker. The document I’m referring to above has so many grammatical and phrasing errors that it’s very difficult to extract the meaning from the text.
Complexity is the number-one enemy of high-quality code.
 
The following users thanked this post: mark03

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: STM32H SPI low lever transfer
« Reply #7 on: September 07, 2020, 07:45:42 pm »
I'm going with he didn't turn the clocks on to the SPI and GPIO peripherals.
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1906
  • Country: ca
Re: STM32H SPI low lever transfer
« Reply #8 on: September 08, 2020, 06:17:10 am »
Quote
I'm going with he didn't turn the clocks on to the SPI and GPIO peripherals.
The clocks are On,do not worry,
Have you done any Direct register SPI transfer in H series? if so, please share the code.
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: STM32H SPI low lever transfer
« Reply #9 on: September 08, 2020, 04:04:09 pm »
Quote
I'm going with he didn't turn the clocks on to the SPI and GPIO peripherals.
The clocks are On,do not worry,
Have you done any Direct register SPI transfer in H series? if so, please share the code.

I didn't see that when you posted your code.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf