cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use GNU Scientific Library with STM32?

DMårt
Senior II

Hello!

Wonder if I can get compile the GNU Scientific Library for STM32? I need to cross compile GNU Scientific Library for STM32 before I can use it in my library. But how can I do that ?

I'm using TrueSTUDIO on Linux and also F401RE Nucleo. ​

I need a better linear algebra library than the built in CMSIS library.

5 REPLIES 5
AvaTar
Lead

I never tried - Microcontrollers are the impersonated cost optimization, so I never came upon such a use case. But don't see a reason why it should not work. The source code for GNU projects is usually available.

However, besides of probable dependencies to to other libs (at least clib), I expect an abysmal performance compared to x86 compatibles and Cortex A processors.

I need to cross​ compile GSL for the CPU of F401RE first. But how can I do that ?

AvaTar
Lead

Microcontroller IDEs like TrueStudio are implicitly cross development tools.

You would need to fetch the GSL source code (your favourite search engine should tell you where), and add it to your F401 project.

Perhaps here: https://www.gnu.org/software/gsl/ and here: http://mirror.inode.at/gnu/gsl/

I would make it a separate library project, but this is a matter of taste.

As said, I'm not sure about dependencies, and sizes. Perhaps you can extract the parts you need, and drop the rest.

S.Ma
Principal

Quick look at the GSL manual PDF:

  • long double: forget it, unpractical
  • double: only STM32F467 and higher STM32 will have HW double instructions

All the functions using 32 bit float or 32 bit integers are the embedded non linux friendly calculation world. Even in android world, HW drivers usually refrain to use float (or double) and use actually a Q32 fractional bit structure: 32 bit for integer, and 32 bit fractional (1/2 1/4 1/8 1/16 1/32k) to remain energy and time efficient at "good enough" precision.

One can sacrifice performance for precision. Even old 8 Bit computer running just BASIC interpreters had floating point numbers and calculations.

But this depends on the project requirements, and probably needs some preinvestigations.