Forum : ARM
Post Information | Post |
---|---|
October 7, 2010 - 10:46am
|
Hi, I'm using Rlink with a STM32 @ 72Mhz and i have noticed a problem when monitoring its SPI registers. When i do this : /* Loop while DR register in not empty */ /* Loop while DR register is empty */ -- Condition on Flash_data to stop polling loop -- The RXNE flag of SPI is "SET" at the Breakpoint and becomes "RESET" without clic on "run' mode ! Without the Breakpoint it works but not all the times (that's why i had set a Breakpoint here). Without Rlink, using the printf instruction and Hyperterminal, the program works well with or without the loop. Is there a problem with STM32 SPI when using Rlink ? Rémy |
I seem to have the exact same problem. Some kind of information regarding this would be welcome
Hi,
I had this problem too, but eventually stumbled across the cause largely by accident.
It seems to be caused simply by having the corresponding SPI register window open while debugging. IMPORTANT - this causes the problem both for single-stepping, AND when free-running the code in debug mode. The latter caused my application to hang from anywhere between 2-30 seconds or so once running (which is how I originally encountered the problem).
My guess is that this problem happens because RIDE7/Rlink reads and refreshes all of the registers/watches which you have set up for debugging, either after every single-step, or regularly in the background when free-running the code in debug mode. When RIDE7/Rlink reads the SPI_DR Data Register in order to display it, this clears the RXNE flag in the SPI_SR Status Register and causes the problem.
The solution is simply to close the SPI debug register window in RIDE7. Of course this makes it a bit trickier to debug, but you could have the window open for debugging some bits, and close it when wanting to test the overall operation.
Hope this helps.
Best wishes,
Bart