Skip to main content
Franksterb92
Senior
March 16, 2023
Solved

trying to flash the STM32F030F4P6TR with the stlink v2 the official one. i can get the code to go onto the mcu but wen i try to debug with stm32cubeide it says this Error in executing 'cont' command ... Target is not responding, retrying...

0693W00000aJ8zTQAS.png

This topic has been closed for replies.
Franksterb92
Franksterb92Best answer
Senior
March 18, 2023

just answed my own question so to explain ill post the test code to toggle PA5.the problem is line 8 where im setting GPIOA->MODER to 0 i deleted that and line 5 and it works now i think that the problem is that line set GPIOA MODE to all 0s and the swd pins are on PA13 PA14 so it was messing the debug up

#include "stm32f030x6.h"
 
int main(void){
 
	RCC->AHBENR = 0x00;
	RCC->AHBENR |= (1U<<17);
 
	GPIOA->MODER = 0x00;
	GPIOA->MODER &= ~(1U<<11);
	GPIOA->MODER |= (1U<<10);
 
	while(1){
 
	GPIOA->ODR ^= (1U<<5);
	for(int i = 0; i < 200000; i++){}
	}
}

1 reply

Franksterb92
Franksterb92AuthorBest answer
Senior
March 18, 2023

just answed my own question so to explain ill post the test code to toggle PA5.the problem is line 8 where im setting GPIOA->MODER to 0 i deleted that and line 5 and it works now i think that the problem is that line set GPIOA MODE to all 0s and the swd pins are on PA13 PA14 so it was messing the debug up

#include "stm32f030x6.h"
 
int main(void){
 
	RCC->AHBENR = 0x00;
	RCC->AHBENR |= (1U<<17);
 
	GPIOA->MODER = 0x00;
	GPIOA->MODER &= ~(1U<<11);
	GPIOA->MODER |= (1U<<10);
 
	while(1){
 
	GPIOA->ODR ^= (1U<<5);
	for(int i = 0; i < 200000; i++){}
	}
}