Follow Us
Categories
Archives
- February 2024
- January 2024
- August 2023
- December 2022
- November 2022
- October 2022
- February 2022
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- January 2021
- November 2020
- October 2020
- August 2020
- April 2020
- February 2020
- January 2020
- October 2019
- September 2019
- July 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- October 2018
- September 2018
- August 2018
- July 2018
- April 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- April 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- November 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- February 2013
- January 2013
- November 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
Author Archives: Martin Bond
CMake Presets
Introduction
When we developed the CMake based toolchain for our training projects we used a shell script to simplify invoking the cmake command line. CMake 3.19 added a presets feature that allows us to define command line parameters in a CMakeSettings.json file which can be used in place of using multiple command parameters.
In previous articles about CMake we have shown how we need to specify command line parameters to use CMake with an embedded target toolchain (see CMake Part 3). To […]
Posted in ARM, Build-systems, C/C++ Programming, Toolchain
Leave a comment
C++20 Coroutine Iterators
In my first blog post about C++20 Coroutines I introduced the concepts behind a synchronous or generator style coroutine and developed a template class to support coroutines for any data type.
In this post I’ll add an iterator to the template to support the range-for loop and iterative algorithms. You may want to review that post before reading this one but the following code should act as a reminder about how to write and use a coroutine to read two floating […]
C++20 Coroutines
C++20 Coroutines
There seems to be a lot of confusion around the implementation of C++20 coroutines, which I think is due to the draft technical specification for C++20 stating that coroutines are a work in progress so we can’t expect full compiler and library support at this point in time.
A lot of the problems probably arise from the lack of official documentation about working with coroutines. We have been given C++ syntax support for coroutines (the co_yield and co_return) but without […]
CMake Part 4 – Windows 10 Host
Introduction
In previous blog posts in this series (Part 1, Part 2 and Part 3), I looked at using CMake on a Linux host to configure a build to cross compile to target hardware such as the STM32F4 Series.
In this post, we’ll work with the GNU Arm Embedded Toolchain on a Windows 10 Host.
The first part of this blog discusses running the Windows hosted versions of CMake, GNU Arm Embedded Toolchain and GNU Make. An alternative approach, briefly discussed at the […]
Posted in ARM, Build-systems, C/C++ Programming, CMSIS, Cortex, Toolchain
Tagged CMake, Cross Compiler, Windows 10
Leave a comment
CMake Part 3 – Source File Organisation
Introduction
In previous blog posts in this series (Part 1 and Part 2), I looked at using CMake to configure a build for a cross compilation to target hardware such as the STM32F4 Series. In this blog post I will look at how to configure project source code, identify subsystems and use CMake to manage the build for each subsystem.
In our training courses, we have identified two shared subsystems: the bare metal code used to initialise the C/C++ run time system […]
Posted in ARM, Build-systems, C/C++ Programming, CMSIS, Cortex, Toolchain
Tagged CMake, Cross Compiler
3 Comments
CMake Part 2 – Release and Debug builds
Introduction
In my previous blog post CMake Part – The Dark Arts I discussed how to configure CMake to cross-compile to target hardware such as our STM32F407 Discovery board.
We looked at the minimum requirements to configure the CMake build generator for a cross-compilation project using a project definition file (CMakeLists.txt), a toolchain definition file (toolchain-STM32F407.cmake). The CMake commands used to generate and build the project are:
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=toolchain-STM32F407.cmake
cmake –build build
In the real world, projects are never as simple […]
Posted in ARM, Build-systems, C/C++ Programming, Cortex, General, Toolchain
Tagged CMake, Cross Compiler
10 Comments
CMake Part 1 – The Dark Arts
Introduction
In our previous post Why We Need Build Systems we examined the need for Build Systems in modern software development. In this post we will examine how to use CMake to mange the build process for a cross compilation project.
CMake can be described as a marmite application: you either love it or hate it. Here at Feabhas, we find ourselves falling in the latter category, despite the fact the CMake is widely used within the embedded and deeply embedded development […]
Posted in ARM, Build-systems, C/C++ Programming, Cortex, Toolchain
Tagged CMake, Cross Compiler
6 Comments
Why We Need Build Systems
Build systems were developed to simplify and automate running the compiler and linker and are an essential part of modern software development. This blog post is a precursor to future posts discussing our experiences refactoring the training projects to use the CMake build generator.
Using Build Systems
Build systems can be standalone command line applications such as Make, Scons and Ninja; or part of an (Integrated Development Environment IDE) like Visual Studio , XCode or IAR Workbench.
Configuring build systems for a project […]
Posted in Build-systems, C/C++ Programming, Toolchain
8 Comments
Python 3 File Paths
If you’ve used Python for a while you will probably be familiar with the os module for working with files and directories; often called pathnames by Linux users. In moving to Python 3 you may continue to use the same os and os.path functions from Python 2.7, however a new pathlib module provides an alternative object-oriented (OO) approach.
In this posting, we examine the common file handling situations; comparing the OO approach of pathlib against the procedural approach of os functions.
Current […]
Posted in Python, Python3
Leave a comment
Python 3 Unicode and Byte Strings
A notable difference between Python 2 and Python 3 is that character data is stored using Unicode instead of bytes. It is quite likely that when migrating existing code and writing new code you may be unaware of this change as most string algorithms will work with either type of representation; but you cannot intermix the two.
If you are working with web service libraries such as urllib (formerly urllib2) and requests, network sockets, binary files, or serial I/O with pySerial […]
Posted in Python, Python3
2 Comments