Category: STM32F4

LwIP ethernet on STM32F4-Discovery 17

Ethernet server using STM32F4-Discovery and SD card

It’s been a while since my last library on the web. I’m making ethernet library with TCP client and TCP server support using external PHYs (currently testing with DP83848, but it will support any PHY you want). I have some troubles yet with code, so library is not prepared for download. It will be as soon as I made it clear and stable. Library is available here. Library key features: Currently support only for RMII interface with PHY and STM32F4...

How to properly set clock speed for STM32F4xx devices 71

How to properly set clock speed for STM32F4xx devices

I see that you have problems with your devices when you don’t know even (and you don’t even ask) on which speed your device is actually running. Speed of your device depends on PLL settings or clock source you have selected for system core clock. In most cases system core clock’s source is PLL output. To get proper value, you check ALWAYS first these settings when something is not working. Because I’m tired of questions that something is not working but...

Locked OTP Bytes 7

Library 49- One-Time programmable (OTP) bytes on STM32F4

STm32F4xx devices have OTP (One-Time-Programmable) bytes. They can be used for permanent store of configuration data for your device. Bytes are structured in 16 data blocks where each block has 32 data bytes of available memory. There is also 17th block with 16 bytes of data. His “work” is to store information about states of data block, because you can lock each block forever even if it is totally empty. Important notes: When you write data to specific OTP location...

PWM graph 47

Library 48- Measure PWM input signal with STM32F4

First library in 2015 is here. With it, you will be able to measure PWM input signal from “other world”. STM32F4’s timers have capability to make an interrupt on edge, when signal is active on input pin for specific timer. This allows us, to measure signal in input. With a simple calculations, we can detect frequency of signal and duty cycle. Of course, this is not veery accurate, but with 168MHz F407 device, using 32bit TIM2 (high resolution) I got...

Library 47- CRC module on STM32F4 5

Library 47- CRC module on STM32F4

STM32F4xx devices have CRC (Cyclic Redundancy Check) module inside. This is small and useful unit when working with communications. It might become very useful to verify if your packet of data is correct. STM32F4 devices uses “Ethernet” CRC with polynomial below: X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 +X8 + X7 + X5 + X4 + X2 + X +1 It is quite ugly 😀 Well, using this module is very easy....

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...