STM32U5: Spi and Debug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 6:25 AM
Hello, this is a general question for my understanding.
when I single stepped* through my SPI code, I encountered some unexpected behavior. But when I run over the code, it worked as expected.
*During this time, I had the peripheral SPI view opened.
So my question is, when the debugger updates the view, e.g. by showing me the content of the SPI_RXDR register in the peripheral view, will this already have an effect on the SPI HW, like when I read the SPI_RXDR with SW ?
Or can the debugger read the registers somehow different ?
(A read to SPI_RXDR will have effect to RXFIFO and Rx-Flags)
Solved! Go to Solution.
- Labels:
-
SPI
-
STM32U5 series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 6:45 AM
> So my question is, when the debugger updates the view, e.g. by showing me the content of the SPI_RXDR register in the peripheral view, will this already have an effect on the SPI HW, like when I read the SPI_RXDR with SW ?
Yes, this reads RXDR which clears the RX buffer.
> Or can the debugger read the registers somehow different ?
No, the debugger uses the same reading mechanism as the cpu and has the same effects on the flags.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 6:45 AM
> So my question is, when the debugger updates the view, e.g. by showing me the content of the SPI_RXDR register in the peripheral view, will this already have an effect on the SPI HW, like when I read the SPI_RXDR with SW ?
Yes, this reads RXDR which clears the RX buffer.
> Or can the debugger read the registers somehow different ?
No, the debugger uses the same reading mechanism as the cpu and has the same effects on the flags.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 6:54 AM
@TDK wrote:the debugger uses the same reading mechanism as the cpu and has the same effects on the flags.
@FKaes.1 this applies in general to any & all registers.
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-05-12 11:03 PM - edited ‎2025-05-13 12:10 AM
Hi, just to confirm it, I checked with SPI view open and closed. And the behavior was like explained. With open SPI view, I wasn't able to step over my code (because the RX flags were changed, when the debugger read and display the SPI register). But with closed SPI view, I was able to step over the SPI RX code.
