2025-02-23 08:19 AM
Hi all
I am using the stm32h743 device when using spi 6 to transmit data the clocks
are 4, 5, 6 randomly instead of 8 bits
when configuring spi2 the processor function perfectly.
on this device I have already used
connection: SPI1, SPI5, ethernet, uart4.uart7,uart8, usart1,usart2,usart3
middleware and software package: freertos, LWIP
Timers: Timer1
System core: DMA, GPIO,NVIC, RCC, SYS
CubeMx Version 6.13
CubeIDE 1.16.0
Repository: 1.12.0
Thank you for you answer
2025-02-23 08:56 AM
Show the contents of the SPI6 registers at the time of the error. Logic analyzer trace showing the issue would be good as well.
2025-02-23 10:15 AM
Make sure to clear and populate the SPI Initialization / Instance structure completely.
By default auto/local variables will contain stack junk unless explicitly cleared, and random things can happen.
{
SPI_HandleTypeDef SpiHandle = {0};
...
2025-02-23 11:28 PM
bad spi 5 bits on spi6
good spi 8 bits on spi2
2025-02-23 11:30 PM
i did it. this did not helped
2025-02-24 12:57 AM
2025-02-24 06:20 AM - edited 2025-02-24 06:20 AM
My guess is you're disabling the peripheral too early. Possibly when DMA completes but before the transaction completes. The SPI6 registers would be in the SPI6 instance, not the hspi6 handle.
In any case, your "8 good bits" are certainly not. Look at the clock line. There are 7 clocks plus a spurious edge/pulse on what should be the start of the 8th.
Showing the relevant code would be useful.
2025-02-24 06:20 AM
I have created only SPI 6 software to check if other resources damages spi6
but found that the same random clocks appears 4,5,6 clocks instead of 8
I have also configured spi2 exactly the same but SPI 2 clocks function perfectly.
2025-02-24 06:34 AM
How to do screenshots:
https://www.techrepublic.com/article/how-to-take-screenshots-in-windows-10/
2025-02-24 06:59 AM
my friend I have me reason why it is like that. thank you for your suggestions.