Category Archives: FussyLogic

STM32F0 Discovery Development III

The ARM startup code we discussed last time was enough to get a program to compile, link and run, but it wasn’t enough to support a real C program. There is one primary feature that we’re missing, pre-initialised variables need their initial values copying from flash to RAM. The discovery-basic-template is full of useful information,… Read More »

STM32F0 Discovery Development

In my previous article about the STM32F0-discovery board, I wrote this: I believe it will be possible, with a bit of research, to use the arm-linux-eabi version, and hence to get the cross-compiler direct from the emdebian project. Today’s article is going to be looking at exactly that. I’d like to be able to use… Read More »

Valgrind II — helgrind

Last time we looked at valgrind’s memory leak detector, memcheck. This time we’ll be looking at an even more difficult to catch class of bug, thread race conditions. First let’s be clear what a thread race is: a race is when two threads run code that access the same piece of memory. The outcome is… Read More »

Valgrind I — memcheck

In this series I’m going to give you a quick tour of the valgrind tool suite. valgrind is useful for finding those hard-to-find, serious-repercussion bugs that can sneak into your code. Consider this C++ program: // C++ #include <iostream> // C #include <stdlib.h> // OS #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> using namespace… Read More »

Photo Building (II)

In Part I we deconstructed a sample photograph, and came to some conclusions about how it was made. In this part we’re going to reconstruct a similar photograph in the same style. Firstly I’ll have to define my terms, I’m not planning to go out and buy myself exactly the same set of props; I’ll… Read More »

Asterisk and Cisco 7940

There are a number of guides out on the Internet for getting Cisco phones working with Asterisk. I didn’t particularly find any of them 100% thorough. This then is my guide, documenting the moment I ordered the phone to the moment I made a call on it. I bought a Cisco 7940 phone from eBay.… Read More »

Software Defined Radio (RTLSDR) — Part I

A quick (simple) word first on how radio receivers work. A “message” is created at so-called “baseband”. You can think of it, if you like, as the signal that comes from the microphone in the radio studio. That message is used to modulate a carrier wave. A carrier wave is a pure sinusoid at a… Read More »

WordPress Fight

A quick note in case it helps someone else using WordPress. I had a bit of a fight trying to get WordPress to output the HTML that it was given for a post unaltered, this article records what I did. I write these articles in markdown syntax, then convert them to HTML using pandoc. One… Read More »

Child Gender Ratios

There’s a country where everybody wants to have a son. Therefore each couple keeps having children until they have a boy; then they stop. What fraction of the population is female? (You may assume the question is asked as an expectation of course, since any particular country can be anything in principle — 100% girls… Read More »