cancel
Showing results for 
Search instead for 
Did you mean: 

Debug Cortex-M error

Kumar B
Associate II

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

5 REPLIES 5

>> 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
Up vote any posts that you find helpful, it shows what's working..

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.

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
Up vote any posts that you find helpful, it shows what's working..
turboscrew
Senior III

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

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