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

Dynamic memory runs out

Hi,

Q1) I am facing an issue with the heap memory. I am using the Cjson_Parse function which uses quit a lot of memory. So I am wondering if there is a way to increase the dynamic memory. I already reduced the  CONFIG_MAIN_STACK_SIZE=4096 and increased the CONFIG_HEAP_MEM_POOL_SIZE = 16384 (Max) it helped a bit but not enough. 

Q2) https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/hardware-design/posts/getting-started-with-current-measurements-on-the-nrf9160 I am trying to measure the current using a multi meter but every time I remove the nRF current measurement pin as explained in the link the led turn on and the program bugs out till I put the pin back(During this the board is powered with an external battery). 

  • Hi,

     

    Q1) I am facing an issue with the heap memory. I am using the Cjson_Parse function which uses quit a lot of memory. So I am wondering if there is a way to increase the dynamic memory. I already reduced the  CONFIG_MAIN_STACK_SIZE=4096 and increased the CONFIG_HEAP_MEM_POOL_SIZE = 16384 (Max) it helped a bit but not enough. 

    cJSON can be quite memory hungry when parsing, especially large objects. asset_tracker has a HEAP_MEM_POOL_SIZE=32k for this very reason.

    Could you also show the error log / fault log of the firmware, just to ensure that this is the root-cause of the failure?

     

    Q2) https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/hardware-design/posts/getting-started-with-current-measurements-on-the-nrf9160 I am trying to measure the current using a multi meter but every time I remove the nRF current measurement pin as explained in the link the led turn on and the program bugs out till I put the pin back(During this the board is powered with an external battery). 

    This is likely due to leakage and floating inputs. The LEDs are buffered through transistors, so if there is some leakage on those, they can light up.

     

    Make sure that your am-meter is setup with a high mA threshold (> 100 mA) to ensure that the series resistance does not affect the nRF, as the radio will sink larger currents during initial attach.

     

    Kind regards,

    Håkon

  • Hi,

    There is no error log. The program either fails to parse or restart. The only option I can see is to limit the amount of data. One more question before I close the thread.

    Q) The amount of current needed to power the nRF9160 dk is around 30mA/h. After implementing power saving mode, eDRX , ... etc. I can't get it to go lower than 30mAh while in sleep mode. Is that the absolute max I can reach or there is a way to go to micro Ampere.

  • Hi,

     

    AMG said:
    There is no error log. The program either fails to parse or restart. The only option I can see is to limit the amount of data. One more question before I close the thread.

    If there's a reset, there's an error. Do you have logging enabled? 

     

    AMG said:
    Q) The amount of current needed to power the nRF9160 dk is around 30mA/h. After implementing power saving mode, eDRX , ... etc. I can't get it to go lower than 30mAh while in sleep mode. Is that the absolute max I can reach or there is a way to go to micro Ampere.

    I understand your overall average current consumption restriction, but in order to connect a multimeter in series, the series-resistance must be low to allow for the peak currents during LTE attach.

    Basically, if you do not set the multimeter in a mode that handles high peaks, the voltage will drop and the nRF will get a brown-out reset.

     

    Kind regards,

    Håkon

  • I couldn't get it work with a multi meter. I found an alternative which is a power supply and monitored the current from it. So was just wondering if it was possible to reduce the overall current, knowing that it is closer to the UDP sample power optimized. https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/hardware-design/posts/getting-started-with-current-measurements-on-the-nrf9160#:~:text=Measuring%20current%20on%20the%20UDP%20sample%20in%20NCS.

    Kind regards

  • Hi,

     

    AMG said:
    I couldn't get it work with a multi meter. I found an alternative which is a power supply and monitored the current from it. So was just wondering if it was possible to reduce the overall current

    The udp sample disables serial in both application (non-secure) and in spm (secure), which shuts down the need for having the peripheral clock running in sleep. This gives a low sleep current.

     

    But, before power optimizing, I would strongly recommend that you look into the error you're getting first. Did you get any log output?

     

    Kind regards,

    Håkon 

Related