Category: Tutorials

Library 46- Debug STM32F4 device with SWO feature 43

Library 46- Debug STM32F4 device with SWO feature

All Cortex-M4 devices have feature to output different data for debugging. This can be used instead of one USART available in STM32F4 to display data to user when something is going wrong and you want use debug. STM32F4 has SWD (Serial Wire Debug) option for programming/debugging. All STM32 boards, which have ST-Link on board, uses this option. For programming, only clock and data lines are required. Full SWD also enables you to output something from MCU which debugging. This is...

Overclock STM32F4 device up to 250MHz 21

Overclock STM32F4 device up to 250MHz

Let’s test what STM32F4xx devices can do. I have all “4 speed families” at home so why not to try it how fast we can go. By default, for those who don’t know max frequencies for STM32F4xx devices, they are in list below: 84MHz: STM32F401 MCUs, including Nucleo-F401 board 100MHz: STM32F411 MCUs, including Nucleo F411 board 168MHz: STM32F405/7 and STM32F415/17 MCUs, including STM32F4-Discovery board 180MHz: STM32F427/29 and STM32F437/39 MCUs, including STM32F429-Discovery board Ok, we have everything provided, let’s test how far...

Project 03- STM32F4xx PID controller 33

Project 03- STM32F4xx PID controller

CMSIS files from ARM provides ARM Math functions. There are also PID controller functions in different formats for f32, q31 and q7. This tutorial/project will talk about how to implement PID controller on STM32F4xx using PID functions from ARM. PID Controller Fast about PID controller. PID stands for Proportional-Integral-Derivative controller. This is a control loop feedback mechanism widely used in industrial control systems. It calculates the error between measured value and the desired setpoint value. According to the error, it...

Use printf to output stream on STM32F4 46

Use printf to output stream on STM32F4

It would be nice, if you can simply just use printf to direct output strings to USART, LCD, etc. With ARM C, you are able to do this. You just need to implement some things and you are ready to work. New STDIO library is available here. To enable printf functionality, first you need to create a new __FILE struct. This struct is then called with FILE struct. It can have only one dummy parameter, but it has to be created, because...

Program STM32F4 with UART 14

Program STM32F4 with UART

STM32F4 devices have great feature. They can be programed with only USB to UART converter. Each device has bootloader inside, which supports UART programming. This is not very great method for Discovery boards, because they have better and faster solution on board, ST-link. But if you are working own board, then this solution can be quite nice. In this tutorial, I will go through step-by-step how to program device with USB->UART converter. I will use FTDI’s home made converter. This...

All STM32F4 tutorials 54

All STM32F4 tutorials

Sometime I made a tutorial how to work with something on STM32F4xx device, because is hard and pointless to make library for it for any reason. Tutorials are set to work at least with STM32F4xx devices. Tutorials NR Name Description 1 FIRST TIME First time with STM32F429 Discovery. Coocox project tutorial 2 KEIL UVISION Default project for Keil uVision to work with STM32F4 devices 3 PWM PWM tutorial for STM32F4xx 4 NVIC Nested vector interrupt controller tutorial 5 EXTI External...