Electronic – STM32F103 Debug Error – Cannot Access Target

cortex-m3debuggingkeilstm32

Im having problem at debugging, tried to load basic led toggle program for test purpose and its work fine but when i tried to debug it, im getting " Cannot Access Target, Shutting Down Debug Session ". My other concern is this device has 256 KBytes Flash Memory though at keil there is only 512 KBytes option. Hoping to get some information from you about this problem. Thanks for your time.

MCU = STM32F103CVT6

IDE= Keil 5.34.0.0

Debug_Settings_1Debug_Settings_2Command ErrorDebug Error Type

Best Answer

Well i though this problem was kinda weird but when i found out cubemx generated this code "__HAL_AFIO_REMAP_SWJ_DISABLE();" in "void HAL_MspInit(void)" function. I kinda laughed ^^ and delete it. People who have a similar problem hope will see this answer before spending much time...