cancel
Showing results for 
Search instead for 
Did you mean: 

SPI communication while debuging

Aldo1
Associate II

Hi,

I using STM32F407IG in IAR Embedded workbench.

When I debug the program the SPI communication does not work.

what could be the reason?

Without debug the SPI work

15 REPLIES 15
Andrew Neil
Evangelist III

@Aldo1 wrote:

the SPI communication does not work.

what could be the reason?

Without debug the SPI work


What, exactly, do you mean by that - in what way(s), exactly, does it "not work" ?

What are the SPI lines doing in the "not working" state ?

Aldo1
Associate II

Hi Andrew Neil,

I using this routine: void spi_rtx(struct s_spi *s, unsigned len, unsigned char *rx_buf, unsigned char *tx_buf) of STM.

and for some reason I did not get an answer.

Again, in normal working condition, not in Debugging mode - I'm getting an answer.

Do you mean you can't single step real-time  code and for it to run in a timely manner?

The answer might be to instrument rather than break to code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Tesla DeLorean,

In the code I need to get an answer for a device in SPI as a condition to continue the program.

and when I debug the program I'm not getting an answer.

 


@Aldo1 wrote:

and when I debug the program I'm not getting an answer.


What does that mean?

Is there no activity on the bus?


@Aldo1 wrote:

I using this routine: void spi_rtx(struct s_spi *s, unsigned len, unsigned char *rx_buf, unsigned char *tx_buf) of STM.

and for some reason I did not get an answer.

Again, in normal working condition, not in Debugging mode - I'm getting an answer.


What routine is that? It's not one of the standard ST HAL_... functions.

Please use this button to properly post source code:

AndrewNeil_0-1710153845927.png

 

 

So have you tried stepping into that routine, to see where it goes wrong?

Or, as @Tesla DeLorean suggested, adding some instrumentation/diagnostics that you can watch without the debugger.

Again, what is happening on the SPI lines?

Yes, it is a standard ST function.

I tried to step in this function and probably the DR register do not get the data that I want to send 

the DR register not get the data that I want to send

Andrew Neil
Evangelist III

Again, what is happening on the SPI lines?