ARM Update

Over a year ago I wrote up some notes on setting up an ARM development environment. Since then a change has occurred. Low Level libraries have been made available for the STM32F103. These should fit between the HAL library and the code I was writing. How well the Low Level libraries work is currently an unknown. I haven’t found the time to investigate. The tool chain should largely be the same. A few additional includes may be required to add the Low Level libraries. I hope before too long to try them out to see how they compare to my current method.

New Theme

Today I am going to start playing around with a modified version of the WordPress twenty-seventeen theme. I want to be able to write content in a nicer style and it is easier to do this with a clean slate. Some of the existing content will need reformatting and this will happen when I settle on my style. In the meantime be patient.

ARM Research

ARM Logo

This month I have been spending some time putting together a simple development set-up for 32bit ARM devices. Whilst not yet fully complete I am making steady progress and have begun to document the process. This is easier said than done. I set out to do the simple task of making an LED blink to test my set-up. There is a lot more to learn than what I had originally expected. The 8bit Atmega 328P was simple by comparison.

What I have discovered is a lack of resources based around my set-up & understanding. Hence why I feel the need to document it where I can. My documentation is taking shape HERE. It is likely to evolve over time but it is better to make it available as I write it in the hope it proves useful to others.

Who Broke My Toolchain?

It has been a few weeks since I felt like sitting down and working on a few of my projects. Tonight I decided to put in a little more work on trying to get text displayed on an OLED screen (DN2015-001). Imagine my frustration when I attempted to compile my code only to be presented with errors. Now my code will generate a few errors at the best of times due to the odd typo, but even after correcting these I was still having no luck. Time to Google the error message.

This time it seems I am not at fault. The search revealed that during my upgrade to Fedora 23 I gained a new version of avr-gcc (5.1.0). This version however appears to be broken and has been for a few months. So if I want to continue I have to downgrade to version 4.x. Not something I can be bothered to do when the clock is approaching midnight. I guess that's all I'm going to get done tonight.

New Projects

This month I have started a couple of new projects. It began as one but soon split. The primary project was to make use of a 128x64 I2C OLED display. It has been sitting on the side for a few months after an impulse purchase. It soon became apparent that I needed a way to generate static images for the screen. Although there were programs out there that would convert a bitmap image into the hex code I needed, many were for Windows. So I decided to have a go at converting it myself.

So new to my GitHub repo are:
DN2015-001 – An interface for the SSD1306 OLED Display Driver
DN2015-002 – A bitmap to hex converter for use wwith DN2015-001

Both projects are under development at the moment. How much they develop will depend on how my experimentation with the OLED display goes.

Make List

I have been making use of the Arduino Makefile from for some time but recently I needed more functionality from the Makefile.

I ran across a case when needed to check the number of instructions/clock cycles that my C/C++ code was generating. To do this I needed to have a look at the assembly listing that was created. Reading just the assembly is tricky so adding in the C/C++ that creates it makes following it a little easier.

The instructions contained here detail the commands required to generate the debugging information and the flags for avr-objdump which allow the C++/ASM listing to be generated. Typing in all these commands takes time, hence why I am using a Makefile in the first place. What I needed was to add them to the existing Makefile.

It turns out that the easiest way to do this is not to modify the original Makefile. Instead I created a blank Makefile for my project and include the Makefile. Having done this I can overload and add to its contents.

This is what I came up with, using “make list” will generate a program listing interspersed with the source code.

# Include Arduino Makefile
# ========================
include ~/bin/
# Arduino Makefile downloaded from:

# Override some of the included Makefile settings
# ===============================================

# Add '-g' to compiler flag to embed debug info (doesn't end up in .hex)

# Locate avr-objdump on system
OBJDUMP := $(call findsoftware,avr-objdump)

# Create a listing of asm and C source code
list: $(TARGET).elf
	@echo "Generating Listing"
	$(OBJDUMP) -h -S $(TARGET).elf > $(TARGET).lst

# Override clean target to remove additonal files
	rm -f $(OBJECTS)
	rm -f $(TARGET).elf $(TARGET).hex $(ARDUINOLIB) *~
	rm -rf .lib .dep
	rm -f $(TARGET).map $(TARGET).lst