Why is the MCU disconnecting (due to the ST-LINK losing connection) from the GDB when enabling the SysTick (TICKINT) interrupt register?
I am using the ST-LINK which is built onto/attached to the Nucleo-F767ZI in order to connect to the MCU and interact with it.
I am trying to use SysTick but am unable to enable interrupts with it. Everything else appears to work as it should.
I initially tried this:
#include "./headers/stm32f767xx.h"
void init_sysTick(void)
{
SysTick->LOAD = 18749UL; // set the reload value, speed is 18.75MHz
SysTick->VAL = 0UL; // set the starting value
SysTick->CTRL = 0b111; // enable SysTick, SysTick interrupt and set clock source to the processor clock
}However, this was causing the GDB client to return the message of:
warning: Remote failure reply: E31
Remote communication error. Target disconnected.: No error.
And the GDB server to return the messages:
...
ST-LINK device initialization OK
TraceCaptureStart and SWV event set to APP_TRUE
ST-LINK device status: LOCKUP
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x0000000B
NVIC_CFGFSR_REG = 0x00000000
Error! Failed to read target status
Debugger connection lost.
Shutting down...
The same happens even when using the Cortex-M7 CMSIS drivers to initialise the SysTick too.
Though after playing around with the code a little, I modified the write to the control and status register (CTRL) to not enable the SysTick interrupt:
#include "./headers/stm32f767xx.h"
void init_sysTick(void)
{
SysTick->LOAD = 18749UL; // set the reload value, speed is 18.75MHz
SysTick->VAL = 0UL; // set the starting value
SysTick->CTRL = 0b101; // enable SysTick and set clock source to the processor clock
}I am able to run this without any issues or disconnections.
It is clear that there is an issue with enabling the interrupt, but I am unsure as to what specifically that issue is.
