cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX generated project for STM32L152C-DISCO board without any modification, however it shows "can't access target. Shutting down debug session" during debugging pass MX_GPIO_Init();

XYang.3
Associate II

0693W00000Bc3WPQAZ.jpg 

  1. open stm32cubemx (version 6.2.1)
  2. new project -> access to board selector
  3. select the board "STM32L152C-DISCO"
  4. Initialize all peripherals with their default Mode? Yes
  5. Give project name "test"
  6. Toolchain/IDE changed to MDK-ARM (min version v5.27)
  7. Open project in uVision
  8. compile it, and then start debugging
  9. step over HAL_Init();
  10. step over SystemClock_Config();
  11. step over  MX_GPIO_Init();();
  12. step over MX_ADC_Init();
  13. at this point, the debug show Debugger - Cortex-M error:"Cannot access target. Shutting down debug session" (as shown in the attached screenshot) and get out of debugger mode after you click on "OK".
1 REPLY 1
XYang.3
Associate II

uVision: professional version 5.34.0.0

Firmware Package Version: STM32Cube_FW_L1 V1.10.3