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

Combined normal GPS to MQTT Simple example

Hi, I want to use normal GPS data (not AGPS) to send to my MQTT server.

I work well with MQTT_Simple to send sensor data to my server.

I see a GPS example in /nrf/samples/nrf9160/gps and can run it successfully.

I don't know how to combine these 2 examples, can you give me some clues?

I try to combine, use thread (K_THREAD_STACK_DEFINE), but got a very hard fault when running (stack overflow, Precise data bus error, ....)

My dummy main code

I use ncs v1.5.1, thingy91, ubuntu 18.0.4

Thanks in advance

Parents
  • Hi,

     

    You are on the right track, by looking at the two functionalities you need, and combine those into one application.

    I try to combine, use thread (K_THREAD_STACK_DEFINE), but got a very hard fault when running (stack overflow, Precise data bus error, ....)

    This usually means that you gave the stack that is faulting too little memory, or that you have a out-of-bounds access somewhere in that specific thread. In this case, I see that you have the thread 500 bytes, which is highly likely too little.

     

    When you get the fault information, you also get a memory address of the thread that faulted. You can look at the build-folder/zephyr/zephyr.map to see what thread this corresponds to, and adjust the memory size accordingly.

     

    Kind regards,

    Håkon 

Reply
  • Hi,

     

    You are on the right track, by looking at the two functionalities you need, and combine those into one application.

    I try to combine, use thread (K_THREAD_STACK_DEFINE), but got a very hard fault when running (stack overflow, Precise data bus error, ....)

    This usually means that you gave the stack that is faulting too little memory, or that you have a out-of-bounds access somewhere in that specific thread. In this case, I see that you have the thread 500 bytes, which is highly likely too little.

     

    When you get the fault information, you also get a memory address of the thread that faulted. You can look at the build-folder/zephyr/zephyr.map to see what thread this corresponds to, and adjust the memory size accordingly.

     

    Kind regards,

    Håkon 

Children
Related