STM32F4 Discovery

How to properly enable/disable interrupts in ARM Cortex-M? 7

How to properly enable/disable interrupts in ARM Cortex-M?

Point of this post is not how to use NVIC (Nested Vectored Interrupt Controller) in Cortex-M processors but how to disable/enable interrupts properly for your system to avoid strange behaviours in your code. Let’s assume you have 2 functions, which do some important stuff and they have to make sure that noone interrupts these 2 functions

ARM Cortex-M SCB ICSR register structure. From 1

Get interrupt execution status on Cortex-M processors

You might come to a situation when you wanna know if current code is executing inside interrupt or not. This might be handy when you do a library and you have one function which you wanna call in interrupt handler for specific event or without interrupt handler, buf wanna execute something specific in function only if you are currently in interrupt. You can create 2 different functions of course, but what if you have one very big function, and for...

Library 63- DMA for STM32F4xx 12

Library 63- DMA for STM32F4xx

Having each stream on separate bits for checking flags has really annoying for me! I had to made a library for DMA which will handle all that stuff any maybe a little more for me because it is really stressfull, when I have to change DMA stream. Then you have to change interrupt handler function name, all flag bit locations and so on. Too much work for easily fail and bug is here! To enable/disable interrupts, get/clear flags, you have to...

FFT result of matlab generated signal 55

Library 62- Fast Fourier Transform (FFT) for STM32F4xx

Here is an example of Fast Fourier Transform on STM32F4xx devices. Today, I was looking something on ARM DSP documentation and I saw that some functions for FFT used in my example are deprecated and will be removed in future. That was the main reason I decided to make a library for FFT on STM32F4xx. To use this library, some third-party libraries are also required. All these required files can be found in STM32F4xx Standard peripheral drivers and DSP instructions provided...

SSD1306 OLED I2C LCD with STM32F4 41

Library 61- SSD1306 OLED I2C LCD for STM32F4xx

Yeah, I got it too. These little, small and with nice contrast devices are really great. I2C communication from my module isn’t really powerful because of slow I2C, even at 400kHz. To update full LCD, there are 1024 bytes of data to be transfered. And this can really take a while. But anyway, for having this LCD just to showing small updates and notifications for users in your project, I2C is still nice. Probably I should make it using I2C...

Library 60- CPU load monitor for STM32F4xx devices 3

Library 60- CPU load monitor for STM32F4xx devices

Yesterday, I’ve made a post about monitoring CPU load depending on CPU work and it’s sleep time using DWT counter. This post can be found here. This post is now a library, set together from post about CPU load. Library Features Measures CPU load. Load depends between sleep time and work time of CPU CPU load is updated for every System core clock cycles. In other words, that is each 1 second DWT counter used for measurements Sleep mode which...