This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use Math.h in nrf connect sdk

Hi 

 I want to use Sqrt() function from math.h but in my application it triggers some errors. Kindly guide me on how to properly include the math.h library into my application

Thanks & Regards,

Navin

  • Hi,

    I have attached the error log below. Kindly check and revert back

    Creating solution MLX90632.emProject
    D:/v1.7.1/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DBOARD_DIR=D:\v1.7.1\zephyr\boards\arm\nrf5340dk_nrf5340 -BD:\v1.7.1\zephyr\samples\My_Projects\MLX90632\build_nrf5340dk_nrf5340_cpuapp -SD:\v1.7.1\zephyr\samples\My_Projects\MLX90632 -DNCS_TOOLCHAIN_VERSION=1.7.1 -DDTC_OVERLAY_FILE=D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/nrf5340dk_nrf5340_cpuapp.overlay -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=D:\v1.7.1\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    -- Application: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632
    -- Zephyr version: 2.6.99 (D:/v1.7.1/zephyr), build: v2.6.99-ncs1-1
    -- Found Python3: D:/v1.7.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: D:/v1.7.1/zephyr/.cache
    -- Found dtc: D:/v1.7.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (D:/v1.7.1/toolchain/opt)
    -- Found BOARD.dts: D:/v1.7.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/nrf5340dk_nrf5340_cpuapp.overlay
    -- Generated zephyr.dts: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/build_nrf5340dk_nrf5340_cpuapp/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/build_nrf5340dk_nrf5340_cpuapp/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/build_nrf5340dk_nrf5340_cpuapp/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/build_nrf5340dk_nrf5340_cpuapp/zephyr/dts.cmake
    Parsing D:/v1.7.1/zephyr/Kconfig
    Loaded configuration 'D:/v1.7.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/prj.conf'
    -- Configuring incomplete, errors occurred!
    Including boilerplate (Zephyr base): D:/v1.7.1/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.7.1 for building. (D:/v1.7.1/toolchain/cmake)
    
    D:/v1.7.1/zephyr/samples/My_Projects/MLX90632/prj.conf:16: warning: ignoring malformed line ' CONFIG_NEWLIB_LIBC=y'
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at D:/v1.7.1/zephyr/cmake/kconfig.cmake:268 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      D:/v1.7.1/zephyr/cmake/app/boilerplate.cmake:554 (include)
      D:/v1.7.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      D:/v1.7.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
      CMakeLists.txt:9 (find_package)
    
    
    
    error: cmake failed
    create_nordic_project.py failed (1)

    Thanks,

    Navin

  • Hi,

    The error you are getting could be due to the malformed line in your prj.conf (line 24), where there is a whitespace in line 24 where you've written

    ' CONFIG_NEWLIB_LIBC=y', instead of 'CONFIG_NEWLIB_LIBC=y'.

    Let me know if this worked out.

    Kind regards,
    Andreas

  • HI andreas,

     THank you so much, ITs working.

Related