PicoLibc a C library for embedded systems with limited resources

Embedded-C-

Keith Packard is an active Debian developer and it is also the X.Org project leader and also creator of many X extensions, including XRender, XComposite, and XRandR. PicoLibc is another of his works and this is a C library which is developed for use in embedded devices with limited resources (that is, they have little fixed storage space and RAM). During development, some of the code was borrowed from the Cygwin and AVR Libc project's newlib library, which was developed for the Atmel AVR microcontrollers.

Keith Packard started development after he couldn't find a decent version of Libc, which could be used on low-RAM embedded devices. The project has been developing since last year. In the first stage, the project was a newlib variant, in which the stdio functions were replaced by the compact version of avrlibc (stdio in newlib was not adapted to the heavy consumption of resources).

Since China's current activities are related to ongoing work on RISC-V architecture and development of tools for embedded devices, recently checked the status of libc implementations y concluded of what, with a little tweak, the combination of newlib and avrlibc can be a good universal solution. Initially, the project was developed under the name "newlib-nano", but to avoid confusion with the Newlib library, it was renamed to PicoLibc.

About PicoLibc

In its current form, Picolibc has already done work to remove all code that is not provided under the BSD license (This code was not used in the assembly for embedded devices), which greatly simplified the situation with the project license.

Thread local implementation has been moved from 'struct _reent' to TLS (thread local storage) mechanism. The compact version of stdio is enabled by default, taken from the avrlibc library code (ATmel-specific assembler inserts are rewritten in C).

The tools of Meson are used for compilationWhich allows you to not attach newlib scripts and simplify transferring changes from newlib. A simplified version of the initialization code (crt0) has been added, attached to the executable file, and executed before transferring control to the main () function.

The source code of PicoLibc is distributed under a BSD license and The library supports ARM (32-bit), i386, RISC-V, x86_64, and PowerPC architectures.

About the new version of PicoLibc 1.1

I recently presented the release of the new version of PicoLibc 1.1, in which a helper library has been added to support semi-hosting technology, A that allows code running in a debugger or emulator environment to use input / output mechanisms from the host system.

For systems that support open, close, read, and write system calls, tinystdio adds standardized POSIX I / O interfaces, including fopen and fdopen functions, as well as binding of stdin / stdout / stderr to POSIX-defined file descriptors.

  • Recent changes have been carried over from the newlib code base. Including additional libm stubs for fenv.h, which can be used on systems without calculation support.
  • Added the Hello World application compilation example with picolibc for ARM and RISC-V systems, in addition to removing the newlib, libm, and mathfp directories that contained unused experimental code.

Start using Picolibc

In order to get started with Picolibc, you should know that Picolibc makes use of the meson build system to compile for various hardware platforms on a Linux host using GCC. That is why they must have meson as part of the development environment, in addition to having Python 3 and Ninja installed. For this you can consult the guide of it In the following link. 

Finally, in order to obtain the Picolibc code, you can do it from the following link, where you can find the necessary documentation. 

Or in the same way they can consult the following guide I found on the net and has detailed information.


Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.