Blınkıng STM32F407ZGT6 Development Board

After play with Arduino and BluePill, I decide to make something more serious in term of embedded programming. I order a board from Aliexpress but it was a instant regret because there was no documentation around. Searching the web and surfing one Chinese site the other didn’t help, finally a guy from Reddit post the link of schematics 🙏.

This is a blinking code that use highly expressive abstraction library HAL.

#include "stm32f4xx_hal.h"

int main(void) {
	HAL_Init();

	__HAL_RCC_GPIOC_CLK_ENABLE();

	GPIO_InitTypeDef BlinkPin;

	BlinkPin.Pin = GPIO_PIN_0;
	BlinkPin.Pull = GPIO_NOPULL;
	HAL_GPIO_Init(GPIOC, &BlinkPin);

	for (;;) {
		HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_0);
		HAL_Delay(1000);
	}
}

The repo of the project can be found on Github.

Looks like I’ll play more with these STM boards because it’s so fun. The HAL usage is pretty much same: There is a struct in every header that holds a couple of elements, and we need to initialize them and it looks well documented.


STM32

150 Words

2018-07-27 03:00 +0300