This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK memory problem

Other Parts Discussed in Thread: SYSBIOS

Hi Everyone,

I am currently using concerto F28M35H52C1 as a web server. The NDK version is ndk_2_22_03_20. The html webpage is stored in SD card, and it was working with simple html code. In the last couple of days, I added some more to the html code, such as a picture, and it stopped working in debug mode when I tried to visit the server by typing the IP address in the web browser. The screeshots are shown below. It seems like the NDK memory and heap are not enough. But I tried to increase the sizes in ndk/global from 2048 to 4096 as shown in below figures, but the problem is still there. Can anyone help with this?

Thanks in advance,

Bin

  • Hi Bin,

    It looks like you increased the size of the "NDK Stack thread" task's stack. According to the console error message, the heap has run out. Can you try increasing the heap size ?

    Best,

    Ashish

  • Hi Ashish,

    Thanks for your reply. I tried to increase the heap size from 20480 to 24512 for several times. But every time when I run the M3 core, the error message appeared as shown in the image. Can you also help with this ?

    Thanks,

    Bin

  • Hi Bin,

    From the stack back trace in the screenshot you shared, it looks like main() calls System_abort() on line 129 of AlbaternM3.c file. Can you check what code is executing at this line that is causing the abort ?

    Best,

    Ashish

  • Hi Ashish,

    I checked my main code, and the line 129 is "Watchdog_Params_init(&params1);" and the screenshot is shown below. But before I increased the size of the heap, it was working fine. Any idea on how to change ?

    Regards,

    Bin

  • Hi Bin,

    Though the stack back trace mentions line 129, I am thinking the abort call on line 126 is getting called. You can put a breakpoint at SDSPI_open() and step through to determine whether the open call fails and causes the abort() function to get called.

    By what amount did you increase the heap ?

    Best,

    Ashish

  • Hi Ashish,

    As you advised, I put a breakpoint at line 129 and it confirmed what you said as shown in figure below. I increased the heap size from 20480 to 24512. Any changes should I make to solve this ?

    Many Thanks,

    Bin

  • Hi Bin,

    Bin Li1 said:

    As you advised, I put a breakpoint at line 129 and it confirmed what you said as shown in figure below.

    You mean you put a breakpoint at SDSPI_open() and the call failed right ? Assuming that is what happened, I believe you need to call SDSPI_init() before calling SDSPI_open(). From the screenshot it does not look like SDSPI_init() is being called.

    Another thing I would like you to try is enabling SDSPI logging. This will help determine the reason why SDSPI_open() is failing. Here's how you can enable logging:

    Add to *.cfg file:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

    LoggingSetup.loadLoggerSize = 256;

    LoggingSetup.mainLoggerSize = 512;

    LoggingSetup.sysbiosLoggerSize = 1024;

    var SDSPI = xdc.useModule('ti.drivers.SDSPI');

    SDSPI.libType = SDSPI.LibType_Instrumented;

    Best.
    Ashish

  • Hi Ashish,

    Sorry for my miscommunication, what I meant was the program stopped before it comes to the breakpoint (line 129 as shown in figure). But in my opinion, SDSPI_open was called because there was no message "Failed to open SDSPI" in console. I tried to add the SDSPI logging in my code. This is the first I am using logging, could you please advise me where to check the logging information and how to check? I checked in ROV but cannot find where it is.

    Many Thanks,

    Bin