Tag Archives: series

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, […]

Posted in FussyLogic | Also tagged , , , | Leave a comment

Getting Started With The STM32F0 Discovery

Introduction I’ve added another nice cheap dev board to my collection, the STM32F0 Discovery, which I got from RS in the UK for £. It’s an SGS Thompson (ST) kit, based around their STMF051R8T6 device, which is in turn based on an Arm Cortex M0. I like this sort of dev board so much because […]

Posted in FussyLogic | Also tagged , , , | Leave a comment

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 […]

Posted in FussyLogic | Also tagged , , , | Leave a comment

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 […]

Posted in FussyLogic | Also tagged , , , | Leave a comment

Asterisk For a Small Business (VII)

As we left things last time, we had a nicely organised dial plan that had the minimum of duplicated code, and was essentially a set of tables that mapped endpoints to extensions or queues. Let’s remind ourselves. [internal-extensions] ; Numeric aliases exten => 2100,1,Goto(andyp,1) exten => 2101,1,Goto(wife,1) exten => 2102,1,Goto(handytone1,1) exten => 2103,1,Goto(handytone2,1) exten => […]

Posted in FussyLogic | Also tagged , | Leave a comment

Asterisk For a Small Business (VI)

Last time I showed you how to add voicemail facilities to your incoming lines. We concentrated on the local end, how a single access number could pickup voicemail from different mailboxes depending on the extension it was dialled from. I didn’t discuss the receiving side very much, and simply gave you this template: [external] exten […]

Posted in FussyLogic | Also tagged , | Leave a comment

CPU, Interrupted — Timers II

When last we spoke on this subject I had left you with a time-accurate but impractical timer interrupt handler. #define F_CPU 16000000 uint8_t Timer_ms = 0; static void initTIMER1( void ) { // CTC mode (WGM1[3:0] = 0x04) TCCR1A = 0; TCCR1B = _BV(WGM12); // CLK/8 prescaler (see datasheet for table) TCCR1B |= _BV(CS11); // […]

Posted in FussyLogic | Also tagged , , , , , | Leave a comment