2015-07-17 04:55 AM
Good day,
I'm pretty new with stm32 microcontrollers and I have some trouble, so I would like to ask you for help. Yesterday I downloaded Visual Studio and VisualGDB for programming. Everything worked fine, I uploaded few times test application with blinking LED. After that I tried to test button. I didn't find any tutorials so I tried to write something by myself (Now, I think that was a stupid idea). I wrote something like this:#include <
stm32f4xx_hal.h
>
#ifdef __cplusplus
extern ''C''
#endif
void SysTick_Handler(void)
{
HAL_IncTick();
HAL_SYSTICK_IRQHandler();
}
int main(void)
{
HAL_Init();
__GPIOA_CLK_ENABLE();//Clock for LED
__GPIOC_CLK_ENABLE();//Clock for Button
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.Pin = GPIO_PIN_5;//LED pin
GPIO_InitStructure.Pin = GPIO_PIN_13;//Button pin
//Led
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
GPIO_InitStructure.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
//Button
GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
GPIO_InitStructure.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
for (;;)
{
if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13)){
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
}
else{
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
}
}
}
Microcontroller successfully uploaded program, but it didn't work like I expected.
After this I tried to get back to LED blinking but I got this error:
[img]http://i.imgur.com/RGTJPrk.png[/img]
Did I killed STM32F411 or this is something fixable?
Thank you.
#error #nucleo
2015-07-17 05:22 AM
You need to program the pins individually, here you're breaking pin PA13 which is the debugger interface signal SWDIO
Connect the BOOT[0] pin to VDD, connect to the board and erase the part with the ST-LINK Utilities, or equivalent applications.2015-07-17 05:42 AM
Thank you very much! It worked!