Skip to main content
Scotty55
Associate III
Jun 11, 2023 3:10 PM UTC
Question

Are there any plans to integrate Picolibc into the GCC toolchain?

It has many advantages over newlib and eliminates dynamic memory usage for printf and scanf of floating point data.

    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    Jun 11, 2023 4:15 PM UTC

    What's stopping you from linking whatever libraries you want?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Scotty55
    Scotty55Author
    Associate III
    Jun 11, 2023 5:17 PM UTC

    So far as understood some discussions, thread level storage and locking has to be integrated with the operating system, e.g. FreeRtos or Azure/ThreadX. How do I do that with STs RTOS implementations?

    Tesla DeLorean
    Guru
    Jun 11, 2023 5:31 PM UTC

    For TLS that would be why you'd use the heap or stack rather than statics.

    For context you'll have do that at a thread level, so yes the OS and perhaps at a register one too.

    You could perhaps use a resource pool rather than the heap, but you'd need to guard against leaks.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Scotty55
    Scotty55Author
    Associate III
    Jun 11, 2023 6:08 PM UTC

    Thank you for your response, but maybe I should explain my actual problem.

    I need to implement a Json RPC interface listening to several communication channels. It should be able to handle floating point numbers, or we have to scale all data to integer which is here a rather complex problem.

    The Json C++ library uses finally - of course - the low level C library functions to generate and parse strings and numbers. Newlib has a really awful float print and scan interface which uses dynamic memory. Picolibc is much better and doesn't use dynamic memory at all.

    In both cases I need locking, because several threads are necessary to handle the communication. Newlib does this with the well known ******** code, and I am still not convinced that the actual ST toolchain provides a bullet proof implementation. Picolibc uses native Thread Level Storage and should avoid these problems.

    Now, what do you recommend?