2019-10-29 05:56 PM
2019-10-30 02:15 AM
Function like log() or exp() are (usually) found in the math library (libm.a), which even host-based compilers do not link against by default.
Just look up the appropriate lib version for the platform, and add to the project.
I would think twice before using using expensive (code space, runtime) emulation code. Mind you, these (POSIX / ISO-C) functions are double. The float namesakes end in f ( expf(), logf(), etc.)
2019-10-30 07:01 AM
Do you know where can i find this libm.a and how to ad it to the smt32cubeide linker?
2019-10-30 07:44 AM
Use linear interpolation. The stepsize will determine how closely the linear interpolation is to the real thing. I use Octave (mathlab) to generate comma seperated lists that i cut & paste into a C array.
2019-10-30 07:50 AM
This (libm.a) is the POSIX name of the library, in a POSIX environment.
With your Cortex M toolchain, it is most probably different.
Most gcc-based IDEs use to come with several versions, for M0, M3, M4, soft, softFP and hardFP - ABI.
The name use to reflect the version/target. Check the manuals/help. I hope CubeIDE has one.
Some toolchains choose the proper lib if you select floatingpoint support during setup (project wizard).
I'm no CubeIDE user.