Spi clocks are 4, 5, 6 instead of 8 bits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-23 8: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
Solved! Go to Solution.
- Labels:
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-25 3:00 AM
So that is one covered by the Manual I linked:
So, again, did you remove R118 ?
If not, that explains why you couldn't use PA5!
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-23 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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};
...
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-23 11:28 PM
bad spi 5 bits on spi6
good spi 8 bits on spi2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-23 11:30 PM
i did it. this did not helped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 12:57 AM
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 6:20 AM - edited ‎2025-02-24 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 6:34 AM
How to do screenshots:
https://www.techrepublic.com/article/how-to-take-screenshots-in-windows-10/
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 6:59 AM
my friend I have me reason why it is like that. thank you for your suggestions.
