2019-11-02 09:47 AM
Hi,
I want to debug a code for USART ISR Handler. The code is working fine. But If I debug, I am getting this error. I am using keil uvision.
Cannot access target.
shutting down debugging session.
Why this error is coming. And how to over come this? I am using STM32 discovery board
Regards,
kumar
2019-11-02 10:08 AM
>> STM32 discovery board
That describes dozens of boards. Link to the product page of the specific board you have, or provide the complete part number of the chip on the board.
Generally if you go into a low power mode (WFI) it will power down the debug interface. Also changing the GPIO pins used by the debugger will also cause loss of connectivity.
You really should try to debug this by inspection rather than break-pointing the IRQ handler.
Perhaps use the SWO/SWV debug channel to output real-time telemetry, Or use a ring-buffer which later outputs to another USART.
2019-11-02 10:30 AM
Hi,
Thanks for the reply.
I am using STM32F407VG discovery board. As you said, how to debug this by inspection rather than break-pointing the IRQ handler. Is there any specific example or configuration.
2019-11-02 10:55 AM
By inspection means you walk your code to understand flow/logic
Remember a USART needs to do everything within a single byte time, can't be doing a huge amount of processing, or blocking waiting on other peripherals, etc.
2019-11-03 09:28 PM
Breakpoint in USART interrupt handler probably messes up USART, but it shouldn't kill the debugging interface. I think the SW uses some lines that are also used for debugging.
2019-11-03 09:40 PM
Run an ST uart code example and compare if it is SW or HW issue first. Zoom back.