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

nRF9160 system gets stuck in "getaddrinfo" function

Hi,

I am using NCS v1.1.0 and modem fw 1.1.0.

We had prepared our application in NCS v1.0.0 and now i have moved it to v1.1.0. 

In new sdk v1.1.0 ,When i try to get Address of the server using "getaddrinfo" system gets stuck in that function. 

I debugged it and found that it gets stuck in "nrf_getaddrinfo" function inside "getaddrinfo". 

I found below similar case on developer zone. 

https://devzone.nordicsemi.com/f/nordic-q-a/55840/getaddrinfo-in-can-block-indefinitely-after-lte-connect/226889#226889

As mentioned in the case , I verified the LTE connection. I always call "getaddrinfo" after LTE connection.

Can you help me in resolving this issue ?

Regards,

Smitesh Mali

Parents
  • Hello, 

    We had prepared our application in NCS v1.0.0 and now i have moved it to v1.1.0. 

     Did your application work before moving to v1.1.0? Have you based your application on any of our samples or is this built from ground up?

    In new sdk v1.1.0 ,When i try to get Address of the server using "getaddrinfo" system gets stuck in that function. 

    I debugged it and found that it gets stuck in "nrf_getaddrinfo" function inside "getaddrinfo". 

     Are you getting any error messages? When and where are you calling the function in your application? I will need some more information about the application to be able to help. 

    As mentioned in the case , I verified the LTE connection. I always call "getaddrinfo" after LTE connection.

     And as mentioned by my colleague in that ticket:

    "How is the signal strength where you are testing? If you are certain you are connected to the network, and the signal strength is good could you take a modem trace when getaddrinfo hangs, so that we can analyze further?"

    Thanks!

    Kind regards,
    Øyvind

  • Did your application work before moving to v1.1.0? Have you based your application on any of our samples or is this built from ground up?

    Yes, my application was working before moving to 1.1.0. My application is based on "http application update" sample example. 

    Are you getting any error messages? When and where are you calling the function in your application? I will need some more information about the application to be able to help.

    No i am not getting any error message. It just gets stuck inside "nrf_getaddrinfo" function. I am calling "getaddrinfo" function after modem connects with network. There is delay of 1 second after connecting with network.  

    "How is the signal strength where you are testing? If you are certain you are connected to the network, and the signal strength is good could you take a modem trace when getaddrinfo hangs, so that we can analyze further?"

    I will try to tell you signal strength tomorrow. But there doesn't seem to be issue of signal strength as if i run "mqtt_sample" example in same hardware then i get address from "getaddrinfo" and also connecting with server without issue. 

    Regards,

    Smitesh Mali

  • Hi,

    "connect_to_provision" is made by us. We call "getaddrinfo" in this function.

    I was calling "connect_to_provision" through "k_work_submit" (scheduler) but now i have stopped calling it from "k_work_submit".

    Regards,

    Smitesh Mali

  • Ok, good to hear you found a solution!

    I would compare the Zephyr BSD socket chapters between v1.0.0 and v1.1.0 if you need more information. 

  • Please do so.

    As we want to find why calling "getaddrinfo" through "k_work_submit" fails. 

    Regards,

    Smitesh Mali

  • The k_work_submit routine has not changed the last three years. 

    Have you ensured that you have the correct priority on your routines?

    -Øyvind

  • Hi,

    How can i set priority for my routines ?

    Regards,

    Smitesh Mali

Reply Children
Related