Skip to main content
Kumar B
Associate III
November 2, 2019
Question

Debug Cortex-M error

  • November 2, 2019
  • 3 replies
  • 2070 views

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

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
November 2, 2019

>> 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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Kumar B
Kumar BAuthor
Associate III
November 2, 2019

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.

Tesla DeLorean
Guru
November 2, 2019

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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
turboscrew
Senior III
November 4, 2019

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.

S.Ma
Principal
November 4, 2019

Run an ST uart code example and compare if it is SW or HW issue first. Zoom back.