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/AM5746: Workaround the SMP project and compile switch

Guru 24520 points

Part Number: AM5746
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi TI Experts,

Would you please confirm the following questions?

[Question.1]

This problem of link error in SMP mode with PDK. Since the following functions are only Undefined Symbol. 
ti_sysbios_family_arm_a15_Cache_wb__E
ti_sysbios_family_arm_a15_Cache_wbInv__E
ti_sysbios_family_arm_a15_Cache_inv__E

So, Customer prepared a wrapper to connect to smp/Cache.h like below. 
They will use this solution until you will modify this issue. How do you think?

[Solution]

//// main.cfg(cfg file) ///////////////////////////

// @@ for SMP add-S
BIOS.smpEnabled = true;
// Chose "true" or "false".
// ("false" = same as not set).
// @@ for SMP add-E

// @@ for SMP add-S

if (BIOS.smpEnabled) {
var Core = xdc.useModule('ti.sysbios.family.arm.a15.smp.Core');
Core.useSkernelCmd = false; /* Set to false if running in CCS and using gel files to wake-up secondary cores */
Core.numCores = 2;
var Cache = xdc.useModule('ti.sysbios.family.arm.a15.smp.Cache');

var SysStd = xdc.useModule('ti.sysbios.smp.SysStd');
var SysMin = xdc.useModule('ti.sysbios.smp.SysMin');
var LoggerBuf = xdc.useModule('ti.sysbios.smp.LoggerBuf');
} else {
var Core = xdc.useModule('ti.sysbios.hal.Core');
var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
var SysStd = xdc.useModule('xdc.runtime.SysStd');
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
}
// @@ for SMP add-E

//// Cache wrapper for PDK driver used for SMP system
/*
* dymmy_cache.c
*/

#define MP_MODE_SINGLE_ONLY (0)
#define MP_MODE_AMP (1)
#define MP_MODE_SMP (2)
#define MP_MODE MP_MODE_SMP
// #define MP_MODE MP_MODE_SINGLE_ONLY

#if (MP_MODE == MP_MODE_SMP)

#include <ti/sysbios/family/arm/a15/smp/Cache.h>
Void ti_sysbios_family_arm_a15_Cache_wb__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
{
Cache_wb(blockPtr, byteCnt, type, wait);
}

Void ti_sysbios_family_arm_a15_Cache_wbInv__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
{
Cache_wbInv(blockPtr, byteCnt, type, wait);
}

Void ti_sysbios_family_arm_a15_Cache_inv__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
{
Cache_inv(blockPtr, byteCnt, type, wait);
}
#endif //

[Question.2]
Is there a compile SW that can check the value of "BIOS.smpEnabled" ?

Best regards.
Kaka

  • Hi Kaka,

    The code example in Q1 looks correct.

    For Q2, "Is there a compile SW that can check the value of "BIOS.smpEnabled" ?" =====> This is a configuration in .cfg with BIOS.smpEnabled = true or false; Then you compile the SYSBIOS project. I thought you can do a pre-defined symbol in the CCS project, like -DSMP_MODE, then in the .c code:

    #ifdef SMP_MODE

    #include <ti/sysbios/family/arm/a15/smp/Cache.h>
    Void ti_sysbios_family_arm_a15_Cache_wb__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
    {
    Cache_wb(blockPtr, byteCnt, type, wait);
    }
    ....
    #endif

    Regards, Eric
  • Hi Eric,

    Thank you for your response.
    I informed your comment to our customer. If I get their feedback, I will be back here.

    Best regards.
    Kaka