STM32F4 – Behold the Project Wizard!

I know about a project wizard that can create a C/C++11 project template for STM32F407 device and GCC toolchain in a snap of a finger. Furthermore, he delivers breathtaking magic by supporting mbed SDK including mbed-RTOS, FreeRTOS and SafeRTOS!

mbed-sdk-open-sourceFreeRTOSSafeRTOSNo doubt, his magic is strong, and luckily, he is on your side. ^^ He relieves you of several boring development tasks. You may now finally focus on more important tasks like coding and testing. And it just happens I know his whereabouts, so you can meet him in person right away.

ProjectWizard Continue reading

Advertisements
Posted in Embedded Systems, STM32F4 | Tagged , , , , , , , , , , | 1 Comment

STM32F4 – mbed Your Code: Zero Switching Costs When Changing ARM Platforms

What would general Ackbar say if he saw you using a firmware code directly in an user application?

It’s a trap, indeed! Just compare the device specific details of this and this main functions. The former depends on the firmware code that is device specific. To reduce code adaptation costs when switching between devices with the same functionalities (UART, CAN, Ethernet,…), heavy-weight operating systems like Linux and Windows implement hardware abstraction layer (HAL). This layer enables user applications to access different devices through standardized interface without code adaptation. Unfortunately, HAL is not available on small OS such as FreeRTOS.

Luckily, mbed.org provides an open-source HAL solution for ARM-based embedded platforms. They have done all the heavy work of implementing drivers for different platforms. All you have to do is to access them device-independently through HAL interface to make your code portable between different platforms. In this tutorial I show how to setup mbed SDK enabled project using my project wizard in less than a minute.

Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , , | 2 Comments

STM32F4 – Code Optimization

The use of C++ language typically increases memory footprint (compared to C). Given the fact embedded systems usually have limited computing/memory resources, this is a very bad news! Luckily, we can use various optimizations to reduce space size or improve computing performance.

Morpheus-CodeCanBeSmallerIn this post I size-optimize the code of the Object Oriented Programming with Embedded Systems (C++ /w STL) project. I reduce the binary size from 100.4 KB to merely 3.4 KB. The combined optimization reduction factor is 29.5, which is a quite nice achievement. Check out the details, how to do it! 🙂

Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , | Leave a comment

STM32F4 – Build Your Own GNU ARM Cross-Toolchain From Scratch

In this tutorial I describe how to build your own GNU ARM cross-toolchain from scratch. I use the latest source available:

  • GCC 4.9.1 4.9.2;
  • embedded C libraries: newlib 2.1 and size optimized newlib-nano 2.1;
  • binutils 2.24 2.25;
  • GDB 7.7

I also provide a build script that accomplishes this task for you without breaking a sweat.

Compile-FreakOut

Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , , | 2 Comments

STM32F4 – Object-oriented Programming with Embedded Systems (C++ /w STL)

In this tutorial I demonstrate that object-oriented programming can be used with embedded system using open source tools and the C++ language. Furthermore, I demonstrate the use of the STL library with C++11 features. Sneak peak, here, here and here.

CppAustinPowers
Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , , , | 5 Comments

STM32F4 – Deploy FreeRTOS Embedded OS in under 10 seconds!

In this tutorial I describe how to build and deploy the FreeRTOS embedded operating system on STM32F4 Discovery board under 10 seconds. So why would you use operating system on such a small embedded system in the first place?

Typically, you don’t if you have a single task problem. However, if you have a multitasking problem (What’s that? See the youtube clip below.), OS provides you among other benefits an infrastructure to seamlessly implement tasks and to run them simultaneously.

Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , | 32 Comments

STM32F4 – In-circuit Debugging

In this tutorial I describe how to configure STM32F4 in-circuit debugging environment using open source tools like GDB or Eclipse. This tutorial is based on the Template Project with Generic Makefile.

6_Debugging Continue reading

Posted in Embedded Systems, STM32F4 | Tagged , , , , | 2 Comments