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.

LP-AM263: DNS assertion

Part Number: LP-AM263

Hi!
I am using ethernet and LWIP for communication with the board, and trying to measure ADC with some frequency (1us - 30ms) 32 times. I am using RTI timer to trigger the Start of Conversion, and reading result in ISR triggered by the End of Conversion. And got the issue with DNS (see attachment)



1. Is it good way to trigger ADC SoC from RTI timer ?
2. How to check task starvation? I assume that the DNS task is pushed out of execution by RTI and ISR, and the software timer triggers, which leads to an assertion.
3. If you have any other recommendations, please tell it.



Regards!

  • Hi Oleg,

    Firstly, Answering your questions:

    1. Yes, it is completely fine to trigger ADC SoC from RTI Timer.

    2. It is possible that DNS task is being starved because of low priority, We can discuss this once we get some clarity.

    Can you please answer a few questions for further clarification, it would help us support you better.

    Q1. Can you share the interrupt configuration, the interrupt that you generate after conversion is complete?

    Q2. Can you briefly explain what do you mean by measuring ADC frequency 32 times?

    There is a possibility that the configuration here is causing high latency and the interrupt being raised constantly which is depriving the DNS task.

    Also, if possible, can you share your source code/project which we can use to debug on our end.

    Regards,
    Shaunak

  • Hi Oleg,

    I would also like to understand what exact parameters are passed to the DNS functions. I assume you are calling dns_gethostbyname() function.

    Regards,
    Shaunak

  • Actually, I do not call dns_gethostbyname() function, at least directly.

    Call stack:

    Assert in function dns_check_entry:

    Assert in default branch (unknown entry->state): 

    variables in function:

  • Q1. Can you share the interrupt configuration, the interrupt that you generate after conversion is complete?

    a. RTI timer configuration:

    //setup SoC by RTI trigger
    
        /* ADC Interrupt Configuration */
        /* Enables an ADC interrupt source. */
        ADC_enableInterrupt(ADC_baseAddr, ADC_INT_NUMBER2);
        /* Sets the source EOC for an analog-to-digital converter interrupt. */
        ADC_setInterruptSource(ADC_baseAddr, ADC_INT_NUMBER2, ADC_SOCNumber);
        /* Enables continuous mode for an ADC interrupt. */
        ADC_disableContinuousMode(ADC_baseAddr, ADC_INT_NUMBER2);
    
        /* use RTI as trigger of start of conversion */
        ADC_setupSOC(ADC_baseAddr, ADC_SOCNumber, ADC_TRIGGER_RTI1, ADC_channel, 16);
        /* Configures the interrupt SOC trigger of an SOC. */
    
    
    //////////////////////////////////////////////
    
    
        TimerP_Params_init(&timerParams);
        timerParams.periodInUsec   = 0;
        timerParams.periodInNsec   = interval_ns; // 30 ms - 1.1 us
    
        TimerP_setup(gTimerBaseAddr[CONFIG_TIMER_AI_MON], &timerParams);

    b. Register interrupt which will be generated an EoC

        /* Register & enable interrupt */
        HwiP_Params_init(&hwiPrms);
        hwiPrms.intNum   = CSLR_R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0;
        hwiPrms.callback = &AI_mon_ISR;
        hwiPrms.isPulse  = 1;
        status = HwiP_construct(&gAI_mon.obj, &hwiPrms);
        DebugP_assert(status == SystemP_SUCCESS);
    
        status = SemaphoreP_constructBinary(&gAI_mon.BinSem, 0);
        DebugP_assert(SystemP_SUCCESS == status);

    ISR:

    static void AI_mon_ISR(void *args)
    {
        if (gAI_mon.i < 32)
        {
            /* Store result */
            gAI_mon.ADC_result_buf[gAI_mon.i] = ADC_readResult(ADC_resultBase, ADC_SOCNumber);
            ++(gAI_mon.i);
    
            ADC_clearInterruptStatus(ADC_baseAddr, ADC_INT_NUMBER2);
            if(ADC_getInterruptOverflowStatus(ADC_baseAddr, ADC_INT_NUMBER2))
            {
                ADC_clearInterruptOverflowStatus(ADC_baseAddr, ADC_INT_NUMBER2);
            }
        }
        else if (gAI_mon.i == 32)
        {
            TimerP_stop(gTimerBaseAddr[CONFIG_TIMER_AI_MON]);
            
            /* buffer filled, stop */
            SemaphoreP_post(&gAI_mon.BinSem);
            ++(gAI_mon.i);
        }
    }

    Q2. Can you briefly explain what do you mean by measuring ADC frequency 32 times?

    I need to measure ADC value with strict periodicity, 32 times in a row. When 32th is done, I stop the timer, and wait next command to handle request for start measuring ADC again.


  • Hi Oleg,

    Would you be able to share your project (as a ZIP file)? It would make it easier for us to debug and root cause the issue. I wanted to understand more on the Ethernet communication side and what exactly is it being used for.

    Regards,
    Shaunak

  • Unfortunately, I have not permission to share the code. Can we make a debug session?

    Regards!

  • Hi Oleg,

    What exactly is the DNS functionality required for in your use-case?

    Regards,

    Shaunak

  • What exactly is the DNS functionality required for in your use-case?

    Hi Shaunak!
    Actually, any functionality of DNS I do not need, and if exist a correct way how to disable it without any consequences, please tell me.

  • Hi Oleg,

    Q1. What example from the SDK are you using/ developing your project on? Based on this I can help you disable DNS

    Q2. Do you use LwIP Functionality in your project?

    In case you are using any LwIP based example, there will be a file named "lwipcfg.h", You can disable the DNS functionality by setting the macro to 0

    Regards,

    Shaunak

  • Could you please write an email, I will send code partly

  • 1. mcu_plus_sdk_am263x_08_05_00_24
    2. Yes

    I will check your solution.

    Thanks!

    UPD: file `lwipcfg.h` does not exist in mcu_plus_sdk_am263x_08_05_00_24

  • Hi Oleg,

    What example from the mcu_plus_sdk_am263x_08_05_00_24 are you using? You can do the following change in LwIP library and rebuild the LwIP library, rebuild your example

    Step-1: In File: mcu_plus_sdk_08_05_00_24/source/networking/lwip/am263x/lwipopts.h

    Step-2: At Line: 87, set the macro LWIP_DNS to 0

    Step-3: Rebuild LwIP library.

    gmake -sj -f makefile.am263x lwip-freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am263x lwip-contrib-freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am263x lwipif-cpsw-freertos_r5f.ti-arm-clang

    Step-4: Rebuild your code (example that you are working on)

    Regards,
    Shaunak

  • Hi Shaunak!
    Unfortunately, the fix did not help.
    I get another failed assert:
    source/networking/lwip/lwip-stack/src/core/udp.c:1185:

    Regards!

  • Hi, can you please share the call stack of the application.

    Please put a breakpoint on udp_remove function, the issue here is a NULL PCB being passed into the udp_remove function, basically the PCB is already NULL and cannot be removed. Also, it would be helpful if you could explain what exact LwIP functionality are you trying to use.

    Regards,

    Shaunak

  • Hi, Shaunak!
    Provided screenshots with the call stack.


    Regards!

  • Hi Oleg,

    The function calls made for dns are from dns.c file in Lwip-stack. The functions will only be compiled if we enable the DNS functionality.

    In my above reply, we had disabled the DNS functionality by setting LWIP_DNS to 0. So the dns_tmr shouldn't have been called.

    1. Can you please recheck your lwipopts.h file, make sure it has

    # define LWIP_DNS 0

    2. Then recompile the Lwip library and your application.

    Can you please do the above and get back to me if you still face any issues.

    Regards,

    Shaunak

  • Hi, Shaunak!
    I work with debug libs, need to add "PROFILE=debug" in the compilation.

    PROFILE=debug gmake -sj -f makefile.am263x lwip-freertos_r5f.ti-arm-clang
    PROFILE=debug gmake -sj -f makefile.am263x lwip-contrib-freertos_r5f.ti-arm-clang
    PROFILE=debug gmake -sj -f makefile.am263x lwipif-cpsw-freertos_r5f.ti-arm-clang

    At first look DNS is disabled successfully, and I do not see issue with DNS assertion.

    I will retest it more deeply, and resolve ticket.

    Thanks for your help!