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.

RTOS/PROCESSOR-SDK-C665X: useModule VS. load package

Part Number: PROCESSOR-SDK-C665X


Tool/software: TI-RTOS

What is the difference between useModule and loadPackage, from below comments, useModule means load and use, loadPackage just load, can I understand "load" means link the related library, but what is the "use" means?

var devType = "c6657"

/* Load the OSAL package */
var osType = "tirtos"
var Osal = xdc.useModule('ti.osal.Settings');
Osal.osType = osType;
Osal.socType = devType;

/* Load the Board package and set the board name */
var Board = xdc.loadPackage('ti.board');
Board.Settings.boardName = "evmC6657";

/* Load Profiling package */
var Utils = xdc.loadPackage('ti.utils.profiling');

/* Load the gpio package */
var Gpio = xdc.loadPackage('ti.drv.gpio');
Gpio.Settings.enableProfiling = true;
Gpio.Settings.socType = devType;

/* Load the uart package */
var Uart = xdc.useModule('ti.drv.uart.Settings');
Uart.socType = devType;

var System = xdc.useModule('xdc.runtime.System');
SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;

/* Load and use the CSL packages */
var Csl = xdc.useModule('ti.csl.Settings');
Csl.deviceType = devType;

  • Hi Tony,

    See this gudie:
    www.ti.com/.../spruex4.pdf

    xdc.loadPackage(package_name). - Loads the specified package and returns a package object. This method finds a package's schema file (package/<package_name>.xds), loads it, initializes packageBase and packageRepository, and calls the package's initialization function. If the
    package cannot be found, this method throws an exception.

    xdc.useModule(module_name) - Enables a module contained in a package for use in the script.

    Best Regards,
    Yordan