[SOLVED] Memory issue encounter with SEGGER

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Memory issue encounter with SEGGER

    Hi,

    I am facing an issue using SEGGER IDE.

    I am facing a memory issue.
    Troubleshooting for quite some time to realise that it isn't my code which is giving me the problem.
    There is no particular code statement that results in the microcontroller hang.
    It should be memory pointer issue.

    It is then I notice the following on the Project Explorer section.
    The column "Code" and "Data".

    index.png (attached)

    The compiler still compiles without error and I can load my program into my nRF52840-DK board.
    But the program will hang when my test program runs.
    When I comment off my codes, reducing the amount of codes, my program works again.
    I notice it has to do with the "Code" column.

    Whenever my code is longer, the size number on this "Code" column, next to my file "LockMsg.C"
    will change color and the number will become a negative number.
    When this happens, my codes will basically hang.
    It doesn't matter which statement.
    I have been troubleshooting for very long time.
    It should be memory issue base on personal experience doing firmware.

    I have check on the following (screen shot below),
    it seems to me that there are pretty much memory still on my nRF52840 chip

    index2.png (attached)

    My question is, what is exactly the column "Code" and "Data" for.
    How do we interpret the number?
    How to read it? What does it indicate?

    Is there anything that I missed out, set wrongly, and don't understand?
    I will need guidance using this SEGGER IDE software.

    Thank you for the help and assistance here.
    Bob.
    Images
    • index.png

      41.21 kB, 572×568, viewed 1,102 times
    • index2.png

      18.45 kB, 398×577, viewed 337 times
  • Hello Bob,

    Thank you for your inquiry.
    The Code and Data rows indicate how much memory does the source from this particular file use in data and code sections.
    The +/- values are always referenced to the last successful build you have done. I assume here that you switch between Debug and Release build where the release build is naturally smaller due to optimization and missing debug information. That is why the LockMsg.c uses less memory when build without debug info and optimization on.

    Keep in mind that a release build is typically not designed to be debugged. Are you trying to debug the release build here? Does the release build application run if you build and flash it to the chip, then reset the chip and let it free running without the debugger, does the application work then?
    If yes then everything is working as expected.

    Should the release config not work for that particular Nordic SDK sample we recommend contacting Nordic support as the SDK is maintained and supported through Nordic and should be created in a way that all samples run out of the box.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.