An Embedded-friendly printf Implementation

We've worked on numerous embedded projects which avoid the use of printf() due to concerns about binary size bloat. Instead, teams will create their own non-standard printf alternative. A classic example is the Arduino SDK's Print class, which requires users to split print statements into multiple function calls to support different variable display formats. Rather …

Implementing Malloc With FreeRTOS

Updated 20191019 In the past I’ve shared malloc implementations which are built using a first-fit free list and ThreadX. Today I’d like to share a malloc implementation based on another popular RTOS: FreeRTOS. Table of Contents: FreeRTOS Memory Allocation A Simple FreeRTOS malloc A Simple FreeRTOS free Heap Initialization with heap_5 Heap 5 Groundwork Adding …

Embedded Artistry libc

If you've been following along with recent posts, you've likely seen many from the Embedded Artistry libc bringup series. I've been documenting and publishing the process of putting together my embedded libc. I've decided to make my libc source a standalone repository. You can build the library and include it in the link step, or …

libc: stdlib, pt. 1

The C standard library is a widely used resource, as it provides the base functionality for many more advanced features. The C standard library provides functionality like: string-to-number conversion math features like division and absolute value memory allocation (malloc, calloc, realloc) random number generation abort/exit However, the usefulness of the standard library doesn’t stop at …

libc: Useful Headers (memory, stdbool, endian, limits)

Continuing on with our libc bringup, today we’ll look at a few simple headers that we need: memory.h stdbool.h endian.h limits.h memory.h memory.h is probably the easiest header we will write. We simply need to use it as an alias for string.h: #include <string.h> stdbool.h Next up is stdbool.h, also a very simple header. Since …

libc: ctype

Next up the libc implementation list are the ctype functions. The ctype functions are pretty simple, covering functions like islower and isalpha. These functions also have "wide" equivalents for increased character sizes (like UTF), but I have just ported the standard versions for now. ctype.h I ported the ctype.h header from musl libc. I removed …