Hi everybody
I am trying to use assertion mechanism provided by xdc.runtime.Assert package.
XDC Help shows how to setup assert identifiers and corresponding messages :
HELP_START
// Mod.xdc import xdc.runtime.Assert; import xdc.runtime.Diags; config Assert.Id A_nonZero = { msg: "A_nonZero: value must be non-zero" };
// Mod.c #include <xdc/runtime/Assert.h> Assert_isTrue(x != 0, Mod_A_nonZero);
// program.cfg var Diags = xdc.useModule('xdc.runtime.Diags'); var Mod = xdc.useModule('my.pkg.Mod'); Mod.common$.diags_ASSERT = Diags.ALWAYS_ON;
HELP_END
I've created file named errmsg.xdc in project directory with following contents:
import xdc.runtime.Assert;
import xdc.runtime.Diags;
config Assert.Id A_nonZero = { msg: "A_nonZero: value must be non-zero" };
config Assert.Id A_noMemory = { msg: "A_noMemory: cannot allocate memory" };
config Assert.Id A_outOfRng = { msg: "A_outOfRng: value out of range" };
then inserted following Assert_isTrue() calls to my application code:
#include <xdc/runtime/Assert.h>
Assert_isTrue(now <= 1000, A_outOfRng);
Assert_isTrue(BepTaskEventDispatcher != NULL, A_noMemory);
and inserted following statement into app configuration file app.cfg
var ErrMsg = xdc.useModule('errmsg');
after building the project I got following errors:
Description Resource Path Location Type
#20 identifier "A_noMemory" is undefined main.c /BootRouter line 66 C/C++ Problem
#20 identifier "A_outOfRng" is undefined main.c /BootRouter line 27 C/C++ Problem
xdc.MODULE_NOT_FOUND: xdc.module: no module named 'errmsg' in the package xconfig_app app.cfg /BootRouter Configuration Validation XDCTools Configuration Marker
xdc.module: no module named 'errmsg' in the package configPkg app.cfg /BootRouter 19 C/C++ Problem
The questions are:
how to configure CCS project to use my own xdc file with assert messages definitions?
how to configure step-by-step Sys/bios based project to define assertions and associated error messages?
My SYS/BIOS configuration:
target: Cortex M-3
CCS version 5.2
SYS/BIOS: 6.33.5.46
XDC tools: 3.23.3.53