XFormat, a Lightweight printf() and sprintf() Alternative


Frequent readers of this blog know that I do not like printf (see “Why I don’t like printf()“), because the standard printf() adds a lot of overhead and only causes troubles. But like small kids, engineers somehow get attracted by troubles ;-). Yes, printf() and especially sprintf() are handy for quick and dirty coding. The good news is that I have added a lightweight printf() and sprintf() implementation to my set of components: the XFormat component. And best of all: it supports floating point formatting :-).

XFormat Component

XFormat Component

Continue reading

About these ads

Eclipse Performance Improvement Tip: Close Unused Projects


Eclipse is not the fastest and snappiest IDE of the world, but in my view the most versatile and open one. And as with any tool: using it the wrong way does not make it better. Sometimes I have students in my classes which complain that Eclipse is slow, even on a decent machine. Looking at their notebook screens and Eclipse workspace usually tells me right away what they are doing ‘wrong': there are many, many projects open in the workspace, the most I have seen was more than 50 projects (yikes!!!)!

Many many projects open

Many many projects open

Continue reading

Review of the CAM8100-U USB Camera with the RIoT Android Board


In my earlier post (“Adding the CAM8000-D Camera Module to the RIoT Board“) I was running into the ‘single camera’ trap of the current RIoT Android OS image: with only one camera attached, and switching between front/back camera, Android is stuck and needs to be flashed again to the board. Because this is so painful and can happen easily, I OKordered a USB camera for the RIoT board: with this that problem should go away, and I would have a front and a back camera.

CAM8100-U Camera Module with RIoT Board

CAM8100-U Camera Module with RIoT Board

Continue reading

Link to Files and Folders in Eclipse


Eclipse projects have the nice features that they can link to files and folders: so instead of having the physical file, it is just a pointer to a file. This is very cool as that way I can point to shared files, or keep files in a common place referenced from projects, and so on.

Linked Folder and File in Eclipse

Linked Folder and File in Eclipse

As with most things in Eclipse, there is not a single way how to do things. So I’m showing in this post several ways how to link to files and folders.

Continue reading

Overwriting Symbols in the GNU Linker File


I start liking the GNU linker (ld) more and more. Yes, that linker command file syntax needs some time to learn, but it is very powerful. I stumbled over an interesting way how to define linker symbols:

/* Linker file for GNU C Compiler */

/* Entry Point */
ENTRY(Reset_Handler)

HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x00000400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x00000400;

The interesting part is how the HEAP_SIZE and STACK_SIZE symbols are defined.

It checks if e.g. __heap_size__ is DEFINED, and if so, it uses that symbol, otherwise it is using 0x400. Very similar to the C/C++ ‘?’ operator. So I can overwrite the default of 0x400 with my value or symbol. The questions is: from where does the symbol come from?

Continue reading

Hacking the Teensy V3.1 for SWD Debugging


I *love* the Freescale Freedom boards, and you probably recognized that with all my projects using them. The Freedom boards are small, inexpensive and can be easily extended with Arduino shields which makes them a great platform for prototyping. But sometimes I just need an ARM microcontroller with some headers, and then the 85mm x 55mm size of the Freedom board is not ideal. That’s nothing new, but I realized that yet again when I did my Adafruit NeoPixel clock: the FRDM board was rather bulky, even if hidden behind that clock. I need something much smaller: the Teensy board!

Size Comparison FRDM vs. Teensy

Size Comparison FRDM vs. Teensy

Continue reading