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.

TI-15.4-STACK-GATEWAY-LINUX-SDK: unable to debug NV with NVDEBUG

Part Number: TI-15.4-STACK-GATEWAY-LINUX-SDK

Hi,

Trying to debug the NV bin file and in the code I see the following reference:

Note: The compile flag NVDEBUG can be passed to enable ASSERT and ALERT
macros which provide assert and logging functionality.

So I added "CFLAGS += -DNVDEBUG" to components/nv/Makefile

But I get errors and warnings on compile:

Compling: linux/nvocmp.c
In file included from linux/nvocmp.c:126:
inc/nvocmp.h:120:8: error: unknown type name ‘NVS_Handle’
 extern NVS_Handle nvsHandle;
        ^~~~~~~~~~
linux/nvocmp.c:264: warning: "NVOCMP_ASSERT" redefined
 #define NVOCMP_ASSERT(cond, message)    NVOCMP_assert((cond), (message), TRUE);
 
In file included from linux/nvocmp.c:133:
inc/nv_linux.h:91: note: this is the location of the previous definition
 #define NVOCMP_ASSERT(cond, message) { \
 
linux/nvocmp.c:265: warning: "NVOCMP_ALERT" redefined
 #define NVOCMP_ALERT(cond, message)     NVOCMP_assert((cond), (message), FALSE);
 
In file included from linux/nvocmp.c:133:
inc/nv_linux.h:88: note: this is the location of the previous definition
 #define NVOCMP_ALERT(cond, message) { \
 
linux/nvocmp.c: In function ‘NVOCMP_initNv’:
linux/nvocmp.c:2125:7: warning: implicit declaration of function ‘NVOCMP_ASSERT1’; did you mean ‘NVOCMP_ASSERT’? [-Wimplicit-function-declaration]
       NVOCMP_ASSERT1(0);
       ^~~~~~~~~~~~~~
       NVOCMP_ASSERT
../../scripts/front_matter.mak:287: recipe for target 'objs/bbb/nvocmp.o' failed
make[1]: *** [objs/bbb/nvocmp.o] Error 1
make[1]: Leaving directory '/home/tsarcasm/workspace_v10/gateway/components/nv'
../../scripts/front_matter.mak:254: recipe for target 'bbb' failed
make: *** [bbb] Error 2



Creating App: (bbb) bbb_collector
~/ti-processor-sdk-linux-am335x-evm-06.01.00.08/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lnv
collect2: error: ld returned 1 exit status
../../scripts/app.mak:94: recipe for target 'bbb_collector' failed
make[1]: *** [bbb_collector] Error 1

Version is TI-15-4-STACK-GATEWAY-LINUX-SDK_4.10.00.06

  • Hi Jorick,

    Can you point me to the file where this is written:

    Note: The compile flag NVDEBUG can be passed to enable ASSERT and ALERT
    macros which provide assert and logging functionality.

  • Hi Marie,

    components/nv/linux/nvocmp.c line 97

    Regards, Jorick

  • Hi Jorick,

    Thank you.  Please allow me one or two days to check with the NV driver software developer.

  • Hi Jorick,

    This define is not meant to be used with the Linux GW, just the SimpleLink CC13x2/CC26x2 SDK. 

    This feature is supposed to work by the user providing “nvprintf" and "Main_assertHandler”. Simply speaking, the user can write their own function in main.c like below (for example) :

     

    void nvprintf(char *msg)
    
    {
    
     //...
    
    }
    
     
    
    void Main_assertHandler(uint8_t reason)
    
    {
    
      //...
      while(1);
    
    }

    The user can do so by doing the following:

    • Using the NVOCMP_ALERT/NVOCMP_ASSERT macros in nv_linux.h. Note that the appropriate logging flags must be enabled (e.g. “nv-debug” or “nv-rdwr”). The customer can refer to the example/collector/collector.cfg file in the “[log]” section for examples of enabling this functionality.
    • Adding printf statements in where desired such as:  LOG_printf(LOG_ALWAYS, "debug message \n");