This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mathematical logarithm function in nrf9160 M33 core

Hi

I am using nrf9160 device and in my application and have to use mathematical logarithm function in my application.

Could you please help me how I can use mathematical logarithm function and also point me to the libararies if any.

I have included math.h but didnt helped me.

The equation which I want to compute in nrf9160 to calculate temperature:

1/t = (ln(Rt/10000)/3434)+1/25

where t is temperature

Rt is Thermistor resistance

with regards

Praveen K

Parents Reply
  • Hi Martin,

    When i use above mentioned configuration in project i am getting below error message.

    C:/Git-Repos/Mercury_NRF/hwTests/prj.conf:12: warning: attempt to assign the value 'y' to the undefined symbol SSE
    Parsing C:/Git-Repos/Mercury_NRF/hwTests/Kconfig
    Loaded configuration 'C:/Git-Repos/Nordic/Master/nrf/zephyr/boards/arm/nrf9160_cl5gm/nrf9160_cl5gmns_defconfig'
    Merged configuration 'C:/Git-Repos/Mercury_NRF/hwTests/prj.conf'
    
    error: Aborting due to Kconfig warnings

    Thanks

    Praveen K

Children
  • Please share your full prj.conf file

    best regards,
    Martin L.

  • Here is my prj.conf

    # General config
    #CONFIG_ASSERT=y
    #CONFIG_LOG=y
    #CONFIG_LOG_DEFAULT_LEVEL=3
    #CONFIG_STACK_SENTINEL=y
    #CONFIG_CP_LOG_LEVEL_INF=y
    
    #Match operations
    #CONFIG_NEWLIB_LIBC=y
    CONFIG_FPU=y
    #CONFIG_SSE=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # Segger RTT
    CONFIG_USE_SEGGER_RTT=n
    CONFIG_RTT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_LOG_BACKEND_UART=n
    
    
    # enable to use thread names
    CONFIG_THREAD_NAME=y
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    CONFIG_NET_NATIVE=n
    
    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    
    # BSD library
    CONFIG_BSD_LIBRARY=y
    
    # AT host library
    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_HEAP_MEM_POOL_SIZE=1024
    
    # Disable native network stack to save some memory
    CONFIG_NET_IPV4=y
    CONFIG_NET_IPV6=n
    CONFIG_NET_UDP=n
    CONFIG_NET_TCP=y
    
    ###gpio related###
    CONFIG_GPIO=y
    
    ###UART CONFIGURATION###
    #Enables serial driver
    CONFIG_SERIAL=y
    
    #Needed for enabling ISRs
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    #UART RAM buffer allocation, see TXD.MAXCNT on nRF9160
    CONFIG_UART_0_NRF_TX_BUFFER_SIZE=1024
    CONFIG_UART_1_NRF_TX_BUFFER_SIZE=1024
    
    ###power management###
    CONFIG_DEVICE_POWER_MANAGEMENT=y
    
    ###RTOS###
    #enables polling
    CONFIG_POLL=y
    
    #PP---???
    #CONFIG_DYNAMIC_OBJECTS=y
    
    #enables ring buffer
    CONFIG_RING_BUFFER=y
    
    #this macro enabled for u8_t to work
    CONFIG_DEPRECATED_ZEPHYR_INT_TYPES=y
    
    
    CONFIG_NRFX_UARTE=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_NRFX_UARTE1=y
    
    
    CONFIG_ADC=y
    #CONFIG_ADC_0=y
    #CONFIG_ADC_NRFX_SAADC=y
    
    #SPI
    CONFIG_SPI=y
    CONFIG_SPI_3=y
    CONFIG_SPI_NRFX=y
    #CONFIG_MAIN_STACK_SIZE=4096
    
    #I2C
    CONFIG_I2C=y
    CONFIG_I2C_NRFX=y
    CONFIG_I2C_2=y
    
    
    
    
    
    
    
    

  • Remove the CONFIG_SSE, but keep the configurations:

    CONFIG_NEWLIB_LIBC=y
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_FPU=y

    That should work.

Related