Hi. I was trying to blink led on stm32f401re nucleo board. I am able to program chip but just after I reset it, stlink lost connection. I tried this with keil and truestudio and every time I program and reset, I lost connection, I can no longer debug or program chip. To program chip, I need to connect stlink utility and erase chip memory from there. Then stlink connection comes back. Different codes from internet seems to work without problem. I think something is wrong with my code but I am not sure. Does anyone know anything about this problem?
The code:
The code:
Code:
#include "stm32f4xx.h"
int main(void)
{
RCC->AHB1ENR |= 0x00000001;
GPIOA->MODER |= 0x0C000400;
while (1)
{
GPIOA->ODR = 0x00000020;
}
}