Hello everybody,
I get trouble when I launch the debug session with Keil MDK-Lite Version: 5.26.2.0. ST-Link/V2 debugger frimware version is V2J33S7.
The microcontroller used for this project is STM32L476 family.
I get this message error when I click "Run" in debug session:
Debugger - Cortex-M Error Cannot access target. Shutting down debug session.
Tried solutions: - Upgrading the firmware of the ST-Link. - Help of this topic: http://www.keil.com/forum/63355/
For more explanation: When I do step-by-step at the beginning of the debug session or a run with a breakpoint at _Set_GPIO_PA11(), I didn't get trouble but if I do run I get the previous error message at instruction:
_Set_GPIO_PA11();
When I comment this line, I didn't get in trouble with debug session.
I really don't understand because GPIOA.11 (eq. PA11) is not a system IO or anything else.
The generated code and configuration is made with STM32CubeMX (MX.5.2.0 version) and the "useful" code is below:
/* I tried both macros and still same error message */ //#define _Set_GPIO_PA11() do { GPIOA->ODR |= GPIO_ODR_OD11; \ // } while(0) #define _Set_GPIO_PA11() do { GPIOA->BSRR = GPIO_BSRR_BS11; \ } while(0) /* ... some other variables initialization ... */ /** Variables initialization -----------------------------------------------*/ /* here is the variables initialization but no need to display them */ /** MCU Configuration-------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /*** Initialize all configured peripherals ***/ MX_GPIO_Init(); MX_ADC1_Init(); MX_DAC1_Init(); /* Rangefinder communication bus init */ MX_I2C1_Init(); /* Temperature sensor communication bus init */ MX_I2C2_Init(); /* Sequence Timer */ TIM1_Init(); /* Initialize UART communication */ USART1_UART_Init(); /*** Rangefinder activation ***/ /* Set GPIO active */ _Set_GPIO_PA11(); /* ... code continue ... */
If somebody could help me, I will be really grateful :)
Thanks
Louis
I am certain, every useful pins are well-connected.
Here is the differents alternative functions mapped on PA11:
TIM1_CH4 TIM1_BKIN2 USART1_CTS CAN1_RX OTG_FS_DM TIM1_BKIN2_COMP1 EVENTOUT
I tried to change init functions order (GPIO_Init()) is the last init function before variables initialization but still same problem...
Hi,
Did you ever find a resolution to this issue? I am having the same error. I'm using a Nucleo L476RG and Keil. I don't immediately see a tie in to the debugger on the Nucleo board in my utilized pins. For my project, I'm using PA2, PB3, PA9, PB13-15.
Thanks,
Frank