Questions tagged [newlib]

Newlib is a C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products.

Newlib is a C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products.

Newlib is only available in source form. It can be compiled for a wide array of processors, and will usually work on any architecture with the addition of a few low-level routines.

See also official cite

160 questions
5
votes
1 answer

Looking for a pure c-version of math.h functions (no co-processor support)

I have to work with some (semi-)automatical verification software (CBMC (link)) which is statically working on C sources. Floating point is supported, but there are no definitions for all the mathematical functions. The attempt is to check, if it's…
sascha
  • 32,238
  • 6
  • 68
  • 110
5
votes
2 answers

Is there a difference between libc, newlib and uclibc interface?

I'm trying to cross-compile an SSH-server to port it on an home-made OS, using newlib (because the OS uses a lib which is based on newlib). I got some troubles with the RedHat Newlib, and I was wondering if I can do my porting with another library…
Pierre
  • 1,162
  • 12
  • 29
5
votes
3 answers

STM32 hard faults when trying to printf numbers >= 10

Temporary Workaround I worked around it with tiny printf: http://www.sparetimelabs.com/tinyprintf/tinyprintf.php https://github.com/cjlano/tinyprintf Probably newlib printf is just taking too much memory. The PC changes to some strange things…
Carl Dong
  • 1,299
  • 15
  • 26
5
votes
2 answers

glibc not supported by Cygwin

Cygwin FAQ has the following info for 'Where is glibc?' : Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult. I was surprised and checked out…
Karthik Balaguru
  • 7,424
  • 7
  • 48
  • 65
5
votes
2 answers

Alternative to Newlib?

I'm an embedded software engineer working with IA-32 type processors. We are looking for a compiler tool chain - preferable free. We used to use Mentor Graphics CodeBench Lite but it's no longer available. We have looked at other GCC distributions…
jkayca
  • 241
  • 3
  • 5
4
votes
1 answer

ARM + gcc: global destructors not called after main() returns, but constructors are

I am trying to write a simple "Hello, World!" firmware for Cortex-M0 CPU. The goal is to correctly initialize and shutdown C++ runtime so that global constructors are called before main() and global destructors are called after main(). So far I…
Max Id
  • 81
  • 6
4
votes
1 answer

Does glibc work on bare metal or RTOS platforms?

Embedded experts, is this possible without major modifications? I'm building firmware that has both a Linux kernel and a minimal RTOS that runs when resuming from sleep. The same toolchain, aarch64-linux-gnu, is used for both Linux and RTOS code.…
Yale Zhang
  • 1,447
  • 12
  • 30
4
votes
1 answer

How do you Implement printf in GCC from Newlib?

I'm struggling to properly implement printf from newlib into my esp32, using GCC. I've gone through the newlib documentation and it gives me general information about how printf is called, but doesn't explain the back end implementation to me. Based…
cDreamer
  • 385
  • 5
  • 18
4
votes
1 answer

What is newlib in C language?

Wikipedia says that "Newlib is a C standard library implementation intended for use on embedded systems". OK, but where can I find the latest canon version of it? i.e the correct true complete version. Also, what other libraries exist for C…
quantum231
  • 2,420
  • 3
  • 31
  • 53
4
votes
2 answers

malloc() in newlib : does it waste memory after one big failure allocation?

I am writing an embedded software for STM32F7 and my libc is newlib-2.4.0.20160527. I have implemented _sbrk() as follows: extern intptr_t g_bss_end; /* value after the last byte in .bss */ extern intptr_t g_msp_lim; /* stack buffer starts at this…
Piotr Jedyk
  • 361
  • 1
  • 10
4
votes
0 answers

GDB debugging arguments passed through newlib

I am trying to use newlib on a TI CC2538 ARM Cortex M3 part. The objective is to use printf for debugging messages and I've actually got that working. However the system will segfault after a number of messages (ARM calls that a HardFault) and I…
dan
  • 61
  • 3
3
votes
2 answers

toolchain and libraries

When we compile a toolchain, we need to specify which library we are using to compile the toolchain. For example, i recently compiled toolchain for openRISC architecture. They gave me an option to choose from uClibc and newlib. Is it necessary to…
Anay
  • 209
  • 2
  • 6
3
votes
1 answer

Page fault with newlib functions

I've been porting newlib to my very small kernel, and I'm stumped: whenever I include a function that references a system call, my program will page fault on execution. If I call a function that does not reference a system call, like rand(), nothing…
user513638
3
votes
2 answers

Why is does char from an array give subscript warning in gcc for isspace in newlib

I´m having troubles understand a compiler warning that we have in our code. The code we have are similar to the one in this example that give the warning (-Wchar-subscripts). We are using ARM gcc 9.2.1 embedded and newlib as standard…
lagget
  • 73
  • 7
3
votes
3 answers

Hard fault on sprintf() with float after toolchain update

I have an opensource project (https://github.com/WhiteFossa/yiff-l), where I use STM32F103 MCU. In firmware I have a lot of sprintf's with float parameters, for example: char buffer[32]; sprintf(buffer, "Power: %.1fW", power); I used to use pretty…
1
2
3
10 11