Skip to main content
XYang.3
Associate
June 25, 2021
Question

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();

  • June 25, 2021
  • 1 reply
  • 1010 views

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".
This topic has been closed for replies.

1 reply

XYang.3
XYang.3Author
Associate
June 25, 2021

uVision: professional version 5.34.0.0

Firmware Package Version: STM32Cube_FW_L1 V1.10.3