Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Error: undefined reference to `__errno'

Hello all,

I am currently using a STM32L4.When I simply want to call the function log() or log10() like this:
Value = log10((double) Value));

The issue is that if I do this call I get the following error when I am compiling the project:

’’‘Building target: Project.elf’
‘Invoking: MCU GCC Linker’
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs -specs=nano.specs -T”../STM32L486VGTx_FLASH.ld” -Wl,-Map=output.map -Wl,- -gc-sections -lm -o “Project.elf” @”objects.list” --
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libm.a(lib_a-w_log10.o): In function `log10’:
w_log10.c:(.text.log10+0x8a): undefined reference to `__errno’
w_log10.c:(.text.log10+0xb2): undefined reference to `__errno’
w_log10.c:(.text.log10+0xee): undefined reference to `__errno’
collect2.exe: error: ld returned 1 exit status
make: *** Project.elf Error 1’’


This problem doesn’t appear when I am using other Math functions like cos() or pow()... What did I do wrong ?


Best regards,

Florian

Tunisia

Hello Florian,

I ve tried to reproduce this problem but in vain.

Could you attach a a minimal project with this issue.

Regards,
Tarek


Hello Tarek,

I’ve just solved this problem by adding m and c librairies in the project properties : Project > Properties > C/C++ Build > Settings > GCC C Linker > Libraries.

Thank you for your answer,

Best regards,

Florian


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs