Our application requires to check the checksum on Flash, ROM, and RAM check every day. Is that any application examples for F2812? Thank you
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.
Our application requires to check the checksum on Flash, ROM, and RAM check every day. Is that any application examples for F2812? Thank you
Zaw,
We do not have anything specifically for the 281x. However, this library and the APIs for the F2802x device can help:
www.ti.com/.../IEC60730SWPACKAGES
While the examples are built for a newer device (I suggest looking at F2802x), you should be able to leverage the memory tests for the 281x by integration into your code and invoking them with the appropriate start address and memory size.
Regards
Lori
Hi Lori,
I am trying to add a space for CRC_TABLE in my flash and having an issue using the config tool (tcf). I can modify the configuration tool without complains but no update in the xxcfg.cmd. I am confused and hope you can help me to go through.
Thanks,
Zaw
environment["ti.bios.oldMemoryNames"] = true;
/* loading the generic platform */
var params = {};
params.clockRate = 150.000000;
params.deviceName = "2812";
params.catalogName = "ti.catalog.c2800";
params.regs = {};
params.regs.pllcr = 0xa;
utils.loadPlatform("ti.platforms.generic", params);
/* enabling DSP/BIOS components */
bios.GBL.ENABLEINST = true;
bios.MEM.NOMEMORYHEAPS = false;
bios.RTDX.ENABLERTDX = true;
bios.HST.HOSTLINKTYPE = "RTDX";
bios.TSK.ENABLETSK = true;
bios.GBL.ENABLEALLTRC = true;
bios.M0SARAM.createHeap = true;
bios.M0SARAM.heapSize = 0x0200;
bios.L0SARAM.createHeap = true;
bios.L0SARAM.heapSize = 0x0200;
bios.MEM.BIOSOBJSEG = prog.get("L0SARAM");
bios.MEM.MALLOCSEG = prog.get("L0SARAM");
bios.TSK.STACKSEG = prog.get("L0SARAM");
/* applying user changes */
bios.FLASH_AB = bios.MEM.create("FLASH_AB");
bios.FLASH_AB.base = 0x3f0000;
bios.FLASH_AB.len = 0x7f80;
bios.FLASH_AB.createHeap = 0;
bios.FLASH_AB.space = "code";
bios.ZONE0 = bios.MEM.create("ZONE0");
bios.ZONE0.comment = "external memory zone 0";
bios.ZONE0.base = 0x2000;
bios.ZONE0.len = 0x2000;
bios.ZONE0.createHeap = 0;
bios.ZONE1 = bios.MEM.create("ZONE1");
bios.ZONE1.comment = "external memory zone 1";
bios.ZONE1.base = 0x4000;
bios.ZONE1.len = 0x2000;
bios.ZONE1.createHeap = 0;
bios.ZONE2 = bios.MEM.create("ZONE2");
bios.ZONE2.comment = "external memory zone 2";
bios.ZONE2.base = 0x80000;
bios.ZONE2.len = 0x80000;
bios.ZONE2.createHeap = 0;
bios.ZONE6 = bios.MEM.create("ZONE6");
bios.ZONE6.comment = "external memory zone 6";
bios.ZONE6.base = 0x100000;
bios.ZONE6.len = 0x80000;
bios.ZONE6.createHeap = 0;
bios.L1SARAM = bios.MEM.create("L1SARAM");
bios.L1SARAM.base = 0x8100;
bios.L1SARAM.len = 0x1b00;
bios.PASSWORDS = bios.MEM.create("PASSWORDS");
bios.PASSWORDS.comment = "CSM Passwords in Flash";
bios.PASSWORDS.base = 0x3f7ff8;
bios.PASSWORDS.len = 0x8;
bios.PASSWORDS.createHeap = 0;
bios.PASSWORDS.space = "code";
bios.BEGIN_H0 = bios.MEM.create("BEGIN_H0");
bios.BEGIN_H0.comment = "Boot to H0 target address";
bios.BEGIN_H0.base = 0x3f8000;
bios.BEGIN_H0.len = 0x2;
bios.BEGIN_H0.createHeap = 0;
bios.BEGIN_H0.space = "code";
bios.BEGIN_FLASH = bios.MEM.create("BEGIN_FLASH");
bios.BEGIN_FLASH.comment = "Boot to Flash target address";
bios.BEGIN_FLASH.base = 0x3f7ff6;
bios.BEGIN_FLASH.len = 0x2;
bios.BEGIN_FLASH.createHeap = 0;
bios.BEGIN_FLASH.space = "code";
bios.FLASH_CD = bios.MEM.create("FLASH_CD");
bios.FLASH_CD.base = 0x3ec000;
bios.FLASH_CD.len = 0x4000;
bios.FLASH_CD.createHeap = 0;
bios.FLASH_CD.space = "code";
bios.FLASH_EF = bios.MEM.create("FLASH_EF");
bios.FLASH_EF.base = 0x3ebf00;
bios.FLASH_EF.len = 0x100;
bios.FLASH_EF.createHeap = 0;
bios.FLASH_GH = bios.MEM.create("FLASH_GH");
bios.FLASH_GH.base = 0x3dc000;
bios.FLASH_GH.len = 0xff00;
bios.FLASH_GH.createHeap = 0;
bios.FLASH_GH.space = "code";
bios.FLASH_IJ = bios.MEM.create("FLASH_IJ");
bios.FLASH_IJ.base = 0x3d8000;
bios.FLASH_IJ.len = 0x4000;
bios.FLASH_IJ.createHeap = 0;
bios.FLASH_IJ.space = "code";
bios.CSM_RSVD = bios.MEM.create("CSM_RSVD");
bios.CSM_RSVD.comment = "Reserved by CSM";
bios.CSM_RSVD.base = 0x3f7f80;
bios.CSM_RSVD.len = 0x76;
bios.CSM_RSVD.createHeap = 0;
bios.CSM_RSVD.space = "code";
bios.ClockTick_PRD = bios.PRD.create("ClockTick_PRD");
bios.processSignal = bios.TSK.create("processSignal");
bios.modbus_in_TSK = bios.TSK.create("modbus_in_TSK");
bios.spi_in_TSK = bios.TSK.create("spi_in_TSK");
bios.COPM_TSK = bios.TSK.create("COPM_TSK");
bios.UI_TSK = bios.TSK.create("UI_TSK");
bios.DIAG_TSK = bios.TSK.create("DIAG_TSK");
bios.Dataflash_TSK = bios.TSK.create("Dataflash_TSK");
bios.HART_in_TSK = bios.TSK.create("HART_in_TSK");
bios.LOG_trace = bios.LOG.create("LOG_trace");
bios.Diag_Sem = bios.SEM.create("Diag_Sem");
bios.modbus_in = bios.MBX.create("modbus_in");
bios.processSignal_in = bios.MBX.create("processSignal_in");
bios.spi_in = bios.MBX.create("spi_in");
bios.COPM_in = bios.MBX.create("COPM_in");
bios.UI_in = bios.MBX.create("UI_in");
bios.Dataflash_in = bios.MBX.create("Dataflash_in");
bios.HART_in = bios.MBX.create("HART_in");
bios.Playback_wait = bios.MBX.create("Playback_wait");
bios.RTA_fromHost.bufSeg = prog.get("L1SARAM");
bios.RTA_toHost.bufSeg = prog.get("L1SARAM");
bios.TSK_idle.stackMemSeg = prog.get("L1SARAM");
bios.LOG_system.bufSeg = prog.get("M0SARAM");
bios.LOG_system.bufLen = 0x80;
bios.MEM.ARGSSEG = prog.get("L1SARAM");
bios.MEM.BIOSSEG = prog.get("FLASH_CD");
bios.MEM.ENABLELOADADDR = 1;
bios.MEM.LOADBIOSSEG = prog.get("FLASH_CD");
bios.MEM.SYSINITSEG = prog.get("FLASH_CD");
bios.MEM.LOADSYSINITSEG = prog.get("FLASH_CD");
bios.MEM.GBLINITSEG = prog.get("FLASH_CD");
bios.MEM.TRCDATASEG = prog.get("L1SARAM");
bios.MEM.LOADGBLINITSEG = prog.get("FLASH_CD");
bios.MEM.LOADTRCDATASEG = prog.get("FLASH_CD");
bios.MEM.SYSDATASEG = prog.get("L1SARAM");
bios.MEM.OBJSEG = prog.get("L1SARAM");
bios.MEM.BIOSOBJSEG = prog.get("L1SARAM");
bios.MEM.MALLOCSEG = prog.get("L1SARAM");
bios.MEM.TEXTSEG = prog.get("FLASH_AB");
bios.MEM.LOADTEXTSEG = prog.get("FLASH_AB");
bios.MEM.SWITCHSEG = prog.get("FLASH_CD");
bios.MEM.LOADSWITCHSEG = prog.get("FLASH_CD");
bios.MEM.BSSSEG = prog.get("H0SARAM");
bios.MEM.EBSSSEG = prog.get("ZONE2");
bios.MEM.CINITSEG = prog.get("FLASH_CD");
bios.MEM.LOADCINITSEG = prog.get("FLASH_CD");
bios.MEM.PINITSEG = prog.get("FLASH_CD");
bios.MEM.LOADPINITSEG = prog.get("FLASH_CD");
bios.MEM.ECONSTSEG = prog.get("FLASH_GH");
bios.MEM.LOADECONSTSEG = prog.get("FLASH_GH");
bios.MEM.CONSTSEG = prog.get("FLASH_CD");
bios.MEM.LOADCONSTSEG = prog.get("FLASH_CD");
bios.MEM.DATASEG = prog.get("FLASH_CD");
bios.MEM.LOADDATASEG = prog.get("FLASH_CD");
bios.MEM.CIOSEG = prog.get("M0SARAM");
bios.MEM.SYSMEMSEG = prog.get("M0SARAM");
bios.MEM.HWISEG = prog.get("FLASH_CD");
bios.MEM.LOADHWISEG = prog.get("FLASH_CD");
bios.MEM.LOADHWIVECSEG = prog.get("FLASH_CD");
bios.MEM.RTDXTEXTSEG = prog.get("FLASH_CD");
bios.MEM.LOADRTDXTEXTSEG = prog.get("FLASH_CD");
bios.GBL.CALLUSERINITFXN = 1;
bios.OTP.comment = "OTP";
bios.H0SARAM.base = 0x3f8002;
bios.H0SARAM.len = 0x1ffe;
bios.BUF.OBJMEMSEG = prog.get("L1SARAM");
bios.PRD.OBJMEMSEG = prog.get("L1SARAM");
bios.ClockTick_PRD.period = 1;
bios.ClockTick_PRD.fxn = prog.extern("BasicClockTick");
bios.ClockTick_PRD.order = 0x3;
bios.HST.OBJMEMSEG = prog.get("L1SARAM");
bios.TSK.OBJMEMSEG = prog.get("L1SARAM");
bios.TSK.STACKSEG = prog.get("L1SARAM");
bios.processSignal.comment = "Signal Processing";
bios.processSignal.fxn = prog.extern("processSignalFxn");
bios.processSignal.arg0 = 0x3e8;
bios.processSignal.stackSize = 0x200;
bios.processSignal.stackMemSeg = prog.get("M0SARAM");
bios.processSignal.priority = 0x2;
bios.modbus_in_TSK.comment = "MODBUS";
bios.modbus_in_TSK.fxn = prog.extern("SciaRxTask");
bios.modbus_in_TSK.stackMemSeg = prog.get("M0SARAM");
bios.modbus_in_TSK.priority = 0xa;
bios.spi_in_TSK.comment = "SPI";
bios.spi_in_TSK.fxn = prog.extern("SpiTask");
bios.spi_in_TSK.stackSize = 0x200;
bios.spi_in_TSK.stackMemSeg = prog.get("L1SARAM");
bios.spi_in_TSK.priority = 0xe;
bios.COPM_TSK.comment = "Continuous Optical Path Monitoring";
bios.COPM_TSK.fxn = prog.extern("COPM_Task");
bios.COPM_TSK.stackMemSeg = prog.get("M0SARAM");
bios.COPM_TSK.priority = 0x3;
bios.UI_TSK.comment = "User Interface";
bios.UI_TSK.fxn = prog.extern("UI_Task");
bios.UI_TSK.stackMemSeg = prog.get("L1SARAM");
bios.UI_TSK.priority = 0x6;
bios.DIAG_TSK.comment = "Diagnostic";
bios.DIAG_TSK.fxn = prog.extern("DiagTask");
bios.DIAG_TSK.stackMemSeg = prog.get("L1SARAM");
bios.DIAG_TSK.priority = 0x5;
bios.Dataflash_TSK.comment = "Dataflash";
bios.Dataflash_TSK.fxn = prog.extern("Dataflash_Task");
bios.Dataflash_TSK.stackMemSeg = prog.get("L1SARAM");
bios.Dataflash_TSK.priority = 0xc;
bios.HART_in_TSK.fxn = prog.extern("HARTInputTask");
bios.HART_in_TSK.stackMemSeg = prog.get("L1SARAM");
bios.HART_in_TSK.priority = 0x9;
bios.IDL.OBJMEMSEG = prog.get("L1SARAM");
bios.LNK_dataPump.order = 1;
bios.RTA_dispatcher.order = 0x2;
bios.IDL_cpuLoad.order = 0x3;
bios.LOG.OBJMEMSEG = prog.get("M0SARAM");
bios.LOG_trace.bufSeg = prog.get("M0SARAM");
bios.PIP.OBJMEMSEG = prog.get("L1SARAM");
bios.SEM.OBJMEMSEG = prog.get("L1SARAM");
bios.Diag_Sem.count = 1;
bios.MBX.OBJMEMSEG = prog.get("L1SARAM");
bios.modbus_in.messageSize = 0x12;
bios.modbus_in.length = 0xa;
bios.modbus_in.elementSeg = prog.get("L1SARAM");
bios.processSignal_in.length = 0x2;
bios.processSignal_in.elementSeg = prog.get("L1SARAM");
bios.spi_in.messageSize = 0xa;
bios.spi_in.length = 0x28;
bios.spi_in.elementSeg = prog.get("L1SARAM");
bios.COPM_in.length = 0x4;
bios.COPM_in.elementSeg = prog.get("L1SARAM");
bios.UI_in.messageSize = 0x4;
bios.UI_in.length = 0x8;
bios.UI_in.elementSeg = prog.get("L1SARAM");
bios.Dataflash_in.messageSize = 0x4;
bios.Dataflash_in.length = 0xa;
bios.Dataflash_in.elementSeg = prog.get("L1SARAM");
bios.HART_in.messageSize = 0x3;
bios.HART_in.elementSeg = prog.get("L1SARAM");
bios.Playback_wait.length = 0x4;
bios.Playback_wait.elementSeg = prog.get("L1SARAM");
bios.QUE.OBJMEMSEG = prog.get("L1SARAM");
bios.LCK.OBJMEMSEG = prog.get("L1SARAM");
bios.SIO.OBJMEMSEG = prog.get("L1SARAM");
bios.STS.OBJMEMSEG = prog.get("L1SARAM");
bios.SYS.TRACESEG = prog.get("L1SARAM");
bios.DHL.OBJMEMSEG = prog.get("L1SARAM");
bios.PIE_INT1_6.fxn = prog.extern("ADCINT_ISR");
bios.PIE_INT1_6.useDispatcher = 1;
bios.PIE_INT3_5.fxn = prog.extern("CAPINT1_ISR");
bios.PIE_INT3_5.useDispatcher = 1;
bios.PIE_INT9_1.fxn = prog.extern("SCIRXINTA_ISR");
bios.PIE_INT9_1.useDispatcher = 1;
bios.PIE_INT9_2.fxn = prog.extern("SCITXINTA_ISR");
bios.PIE_INT9_2.useDispatcher = 1;
bios.PIE_INT9_3.fxn = prog.extern("SCIRXINTB_ISR");
bios.PIE_INT9_3.useDispatcher = 1;
bios.PIE_INT9_4.fxn = prog.extern("SCITXINTB_ISR");
bios.PIE_INT9_4.useDispatcher = 1;
bios.GBL.USERINITFXN = prog.extern("User_Init");
bios.CLK.OBJMEMSEG = prog.get("L1SARAM");
bios.CLK.MICROSECONDS = 100.0000;
bios.PRD_clock.order = 1;
bios.RTDX.RTDXDATASEG = prog.get("L1SARAM");
bios.HWI_NMI.fxn = prog.extern("NMI_ISR");
bios.SWI.OBJMEMSEG = prog.get("L1SARAM");
bios.M0SARAM.base = 0x40;
bios.M0SARAM.len = 0x3c0;
bios.M0SARAM.createHeap = 0;
bios.DIO.OBJMEMSEG = prog.get("M0SARAM");
bios.L0SARAM.len = 0x100;
bios.L0SARAM.createHeap = 0;
bios.L0SARAM.space = "code";
bios.M0SARAM.comment = "M1 SARAM";
bios.M0SARAM.base = 0x400;
bios.M0SARAM.len = 0x400;
if (bios.MEM.LOADTRCDATASEG == prog.get("FLASH")) {
bios.MEM.LOADTRCDATASEG = prog.get("L0SARAM");
}
if (bios.MEM.SYSMEMSEG == prog.get("FLASH")) {
bios.MEM.SYSMEMSEG = prog.get("L0SARAM");
}
bios.FLASH.destroy();
bios.MEM.instance("M0SARAM").comment = "M0SARAM";
bios.MEM.instance("M0SARAM").base = 0x000200;
bios.MEM.instance("M0SARAM").len = 0x0600;
bios.MEM.instance("M0SARAM").len = 0x0800;
bios.MEM.instance("M0SARAM").len = 0x0600;
bios.MEM.instance("M0SARAM").base = 0x000100;
bios.MEM.instance("M0SARAM").len = 0x0700;
bios.MEM.instance("M0SARAM").base = 0x000040;
bios.MEM.instance("M0SARAM").len = 0x07c0;
bios.TSK.instance("processSignal").fxn = prog.extern("SigProcTask");
bios.TSK.instance("TSK_idle").order = 1;
bios.TSK.instance("modbus_in_TSK").order = 2;
bios.TSK.instance("spi_in_TSK").order = 3;
bios.TSK.instance("COPM_TSK").order = 4;
bios.TSK.instance("UI_TSK").order = 5;
bios.TSK.instance("DIAG_TSK").order = 6;
bios.TSK.instance("Dataflash_TSK").order = 7;
bios.TSK.instance("HART_in_TSK").order = 8;
bios.TSK.instance("processSignal").destroy();
bios.TSK.create("processSignal");
bios.TSK.instance("processSignal").arg0 = 1000;
bios.TSK.instance("processSignal").exitFlag = 1;
bios.TSK.instance("processSignal").filter = 2;
bios.TSK.instance("processSignal").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("processSignal").order = 0;
bios.TSK.instance("processSignal").sumformat = "%g inst";
bios.TSK.instance("processSignal").arg4 = 0;
bios.TSK.instance("processSignal").unittype = 0;
bios.TSK.instance("processSignal").comment = "Signal Processing";
bios.TSK.instance("processSignal").allocateTaskName = 0;
bios.TSK.instance("processSignal").arg3 = 0;
bios.TSK.instance("processSignal").stackSize = 512;
bios.TSK.instance("processSignal").iSTATREG = 0x00000000;
bios.TSK.instance("processSignal").filtsummult = 1;
bios.TSK.instance("processSignal").autoAllocateStack = 1;
bios.TSK.instance("processSignal").arg7 = 0;
bios.TSK.instance("processSignal").arg2 = 0;
bios.TSK.instance("processSignal").filtmaxmult = 1;
bios.TSK.instance("processSignal").fxn = prog.extern("SigProcTask");
bios.TSK.instance("processSignal").arg1 = 0;
bios.TSK.instance("processSignal").arg6 = 0;
bios.TSK.instance("processSignal").envPointer = 0;
bios.TSK.instance("processSignal").avgformat = "%.2f inst";
bios.TSK.instance("processSignal").iId = 0;
bios.TSK.instance("processSignal").priority = 2;
bios.TSK.instance("processSignal").maxformat = "%g inst";
bios.TSK.instance("processSignal").arg5 = 0;
bios.TSK.instance("modbus_in_TSK").stackMemSeg = prog.get("ZONE0");
bios.TSK.instance("modbus_in_TSK").stackMemSeg = prog.get("M0SARAM");
bios.PIE.instance("PIE_INT9_2").fxn = prog.extern("ISR_SCIA_Tx");
bios.PIE.instance("PIE_INT9_1").fxn = prog.extern("ISR_SCIA_Rx");
bios.PIE.instance("PIE_INT1_6").fxn = prog.extern("ISR_IntADC");
bios.MBX.instance("Playback_wait").destroy();
bios.TSK.instance("modbus_in_TSK").fxn = prog.extern("Modbus_Task");
bios.TSK.instance("spi_in_TSK").order = 2;
bios.TSK.instance("COPM_TSK").order = 3;
bios.TSK.instance("UI_TSK").order = 4;
bios.TSK.instance("DIAG_TSK").order = 5;
bios.TSK.instance("Dataflash_TSK").order = 6;
bios.TSK.instance("HART_in_TSK").order = 7;
bios.TSK.instance("processSignal").order = 8;
bios.TSK.instance("modbus_in_TSK").destroy();
bios.TSK.create("Modbus_TSK");
bios.TSK.instance("Modbus_TSK").order = 10;
bios.TSK.instance("Modbus_TSK").comment = "MODBUS";
bios.TSK.instance("Modbus_TSK").fxn = prog.extern("Modbus_Task");
bios.TSK.instance("Modbus_TSK").priority = 10;
bios.TSK.instance("Dataflash_TSK").comment = "NVM";
bios.TSK.instance("Dataflash_TSK").fxn = prog.extern("NVM_Task");
bios.TSK.instance("HART_in_TSK").order = 6;
bios.TSK.instance("processSignal").order = 7;
bios.TSK.instance("Modbus_TSK").order = 8;
bios.TSK.instance("Dataflash_TSK").destroy();
bios.TSK.create("NVM_TSK");
bios.TSK.instance("NVM_TSK").order = 10;
bios.TSK.instance("NVM_TSK").priority = 12;
bios.TSK.instance("NVM_TSK").fxn = prog.extern("NVM_Task");
bios.TSK.instance("NVM_TSK").comment = "NVM";
bios.MBX.instance("Dataflash_in").destroy();
bios.MBX.create("NVM_in");
bios.MBX.instance("NVM_in").length = 10;
bios.MBX.instance("NVM_in").messageSize = 4;
bios.TSK.instance("Modbus_TSK").order = 7;
bios.TSK.instance("NVM_TSK").order = 8;
bios.TSK.instance("processSignal").destroy();
bios.TSK.create("SigProc_TSK");
bios.TSK.instance("SigProc_TSK").order = 10;
bios.TSK.instance("SigProc_TSK").arg0 = 1000;
bios.TSK.instance("SigProc_TSK").comment = "Signal Processing";
bios.TSK.instance("SigProc_TSK").priority = 2;
bios.TSK.instance("SigProc_TSK").fxn = prog.extern("SigProcTask");
bios.TSK.instance("SigProc_TSK").stackSize = 512;
bios.PRD.instance("ClockTick_PRD").fxn = prog.extern("Clock_Tick");
bios.TSK.instance("Modbus_TSK").priority = 4;
bios.PIE.instance("PIE_INT9_1").interruptMask0 = "all";
bios.PIE.instance("PIE_INT9_1").interruptMask0 = "none";
bios.PIE.instance("PIE_INT9_1").interruptMask0 = "self";
bios.PIE.instance("PIE_INT9_1").useDispatcher = 0;
bios.PIE.instance("PIE_INT9_1").useDispatcher = 1;
bios.PIE.instance("PIE_INT9_1").interruptMask0 = "self";
bios.TSK.instance("spi_in_TSK").priority = 1;
bios.TSK.instance("spi_in_TSK").priority = 14;
bios.TSK.instance("spi_in_TSK").fxn = prog.extern("SPI_Task");
bios.TSK.instance("SigProc_TSK").order = 9;
bios.TSK.create("GainCtrl_TSK");
bios.TSK.instance("GainCtrl_TSK").order = 11;
bios.TSK.instance("GainCtrl_TSK").fxn = prog.extern("GainCtrl_Task");
bios.TSK.instance("GainCtrl_TSK").priority = 8;
bios.MBX.create("mbxGainCtrl");
bios.MBX.instance("mbxGainCtrl").length = 4;
bios.MBX.instance("processSignal_in").destroy();
bios.MBX.create("mbxAlgo");
bios.MBX.instance("mbxAlgo").length = 2;
bios.TSK.instance("SigProc_TSK").comment = "Algorithm Task";
bios.TSK.instance("SigProc_TSK").fxn = prog.extern("Algo_Task");
bios.TSK.instance("GainCtrl_TSK").order = 9;
bios.TSK.instance("SigProc_TSK").destroy();
bios.TSK.create("Algo_TSK");
bios.TSK.instance("Algo_TSK").order = 11;
bios.TSK.instance("Algo_TSK").fxn = prog.extern("Algo_Task");
bios.TSK.instance("Algo_TSK").priority = 2;
bios.TSK.instance("Algo_TSK").arg0 = 1000;
bios.TSK.instance("Algo_TSK").comment = "Algorithm Task";
bios.TSK.instance("Algo_TSK").stackSize = 512;
bios.MBX.instance("mbxGainCtrl").destroy();
bios.MBX.create("mbxGain");
bios.MBX.instance("mbxGain").length = 4;
bios.MBX.instance("modbus_in").destroy();
bios.MBX.create("mbxModbus");
bios.MBX.instance("mbxModbus").messageSize = 18;
bios.MBX.instance("mbxModbus").length = 10;
bios.MBX.instance("spi_in").destroy();
bios.MBX.create("mbxSPI");
bios.MBX.instance("mbxSPI").messageSize = 10;
bios.MBX.instance("mbxSPI").length = 40;
bios.MBX.instance("NVM_in").destroy();
bios.MBX.create("mbxNVM");
bios.MBX.instance("mbxNVM").messageSize = 4;
bios.MBX.instance("mbxNVM").length = 10;
bios.TSK.instance("COPM_TSK").order = 2;
bios.TSK.instance("UI_TSK").order = 3;
bios.TSK.instance("DIAG_TSK").order = 4;
bios.TSK.instance("HART_in_TSK").order = 5;
bios.TSK.instance("Modbus_TSK").order = 6;
bios.TSK.instance("NVM_TSK").order = 7;
bios.TSK.instance("GainCtrl_TSK").order = 8;
bios.TSK.instance("Algo_TSK").order = 9;
bios.TSK.instance("spi_in_TSK").destroy();
bios.TSK.create("SPI_TSK");
bios.TSK.instance("SPI_TSK").order = 11;
bios.TSK.instance("SPI_TSK").stackSize = 512;
bios.TSK.instance("SPI_TSK").fxn = prog.extern("SPI_Task");
bios.TSK.instance("SPI_TSK").priority = 14;
bios.TSK.instance("SPI_TSK").comment = "SPI";
bios.TSK.instance("Algo_TSK").order = 8;
bios.TSK.instance("SPI_TSK").order = 9;
bios.TSK.instance("GainCtrl_TSK").destroy();
bios.TSK.create("Gain_TSK");
bios.TSK.instance("Gain_TSK").order = 11;
bios.TSK.instance("Gain_TSK").fxn = prog.extern("GainCtrl_Task");
bios.TSK.instance("Gain_TSK").priority = 8;
bios.MBX.instance("COPM_in").destroy();
bios.MBX.instance("HART_in").destroy();
bios.MBX.create("mbxHART");
bios.MBX.instance("mbxHART").messageSize = 3;
bios.MBX.create("mbxCOPM");
bios.MBX.instance("mbxCOPM").length = 4;
bios.TSK.instance("Gain_TSK").fxn = prog.extern("AGC_Task");
bios.TSK.instance("Gain_TSK").destroy();
bios.TSK.create("AGC_TSK");
bios.TSK.instance("AGC_TSK").order = 11;
bios.TSK.instance("AGC_TSK").priority = 8;
bios.TSK.instance("AGC_TSK").fxn = prog.extern("AGC_Task");
bios.MBX.instance("mbxGain").destroy();
bios.MBX.create("mbxAGC");
bios.MBX.instance("mbxAGC").length = 4;
bios.MBX.instance("UI_in").destroy();
bios.MBX.create("mbxUI");
bios.MBX.instance("mbxUI").messageSize = 4;
bios.MBX.instance("mbxUI").length = 8;
bios.MBX.instance("mbxSPI").messageSize = 20;
bios.MBX.instance("mbxSPI").length = 80;
bios.MBX.instance("mbxSPI").length = 4;
bios.MBX.instance("mbxSPI").messageSize = 16;
bios.MBX.instance("mbxSPI").length = 10;
bios.SEM.instance("Diag_Sem").destroy();
bios.SEM.create("semSYS");
bios.SEM.instance("semSYS").count = 1;
bios.TSK.instance("DIAG_TSK").fxn = prog.extern("SYS_Task");
bios.TSK.instance("HART_in_TSK").order = 4;
bios.TSK.instance("Modbus_TSK").order = 5;
bios.TSK.instance("NVM_TSK").order = 6;
bios.TSK.instance("Algo_TSK").order = 7;
bios.TSK.instance("SPI_TSK").order = 8;
bios.TSK.instance("AGC_TSK").order = 9;
bios.TSK.instance("DIAG_TSK").destroy();
bios.TSK.create("SYS_TSK");
bios.TSK.instance("SYS_TSK").order = 11;
bios.TSK.instance("SYS_TSK").priority = 5;
bios.TSK.instance("SYS_TSK").comment = "Diagnostic";
bios.TSK.instance("SYS_TSK").fxn = prog.extern("SYS_Task");
bios.TSK.instance("HART_in_TSK").fxn = prog.extern("HART_Task");
bios.TSK.instance("Modbus_TSK").order = 4;
bios.TSK.instance("NVM_TSK").order = 5;
bios.TSK.instance("Algo_TSK").order = 6;
bios.TSK.instance("SPI_TSK").order = 7;
bios.TSK.instance("AGC_TSK").order = 8;
bios.TSK.instance("SYS_TSK").order = 9;
bios.TSK.instance("HART_in_TSK").destroy();
bios.TSK.create("HART_TSK");
bios.TSK.instance("HART_TSK").order = 11;
bios.TSK.instance("HART_TSK").priority = 9;
bios.TSK.instance("HART_TSK").fxn = prog.extern("HART_Task");
bios.PRD.instance("ClockTick_PRD").fxn = prog.extern("CLK_Tick");
bios.PRD.instance("ClockTick_PRD").fxn = prog.extern("SYS_Clock_PRD");
bios.PRD.instance("ClockTick_PRD").destroy();
bios.PRD.create("Clock_PRD");
bios.PRD.instance("Clock_PRD").order = 5;
bios.PRD.instance("Clock_PRD").period = 1;
bios.PRD.instance("Clock_PRD").fxn = prog.extern("SYS_Clock_PRD");
bios.PRD.instance("Clock_PRD").fxn = prog.extern("SYS_Clock");
bios.PIE.instance("PIE_INT9_4").fxn = prog.extern("UART2_Tx_ISR");
bios.PIE.instance("PIE_INT9_1").fxn = prog.extern("UART1_Rx_ISR");
bios.PIE.instance("PIE_INT9_2").fxn = prog.extern("UART1_Tx_ISR");
bios.PIE.instance("PIE_INT9_3").fxn = prog.extern("HART_Rx_ISR");
bios.PIE.instance("PIE_INT9_4").fxn = prog.extern("HART_Tx_ISR");
bios.PIE.instance("PIE_INT9_1").fxn = prog.extern("Modbus_Rx_ISR");
bios.TSK.instance("Algo_TSK").comment = "Signal Processing Task";
bios.TSK.instance("Algo_TSK").fxn = prog.extern("SIG_Task");
bios.PIE.instance("PIE_INT9_2").fxn = prog.extern("Modbus_Tx_ISR");
bios.PIE.instance("PIE_INT9_1").fxn = prog.extern("Modbus_ISR_Rx");
bios.PIE.instance("PIE_INT9_2").fxn = prog.extern("Modbus_ISR_Tx");
bios.MBX.create("mbxEVNT");
bios.MBX.instance("mbxEVNT").messageSize = 4;
bios.MBX.instance("mbxEVNT").length = 8;
bios.MBX.instance("mbxEVNT").messageSize = 1;
bios.MBX.instance("mbxEVNT").length = 2;
bios.MBX.instance("mbxEVNT").messageSize = 2;
bios.MBX.instance("mbxEVNT").length = 4;
bios.TSK.instance("Modbus_TSK").order = 3;
bios.TSK.instance("NVM_TSK").order = 4;
bios.TSK.instance("Algo_TSK").order = 5;
bios.TSK.instance("SPI_TSK").order = 6;
bios.TSK.instance("AGC_TSK").order = 7;
bios.TSK.instance("SYS_TSK").order = 8;
bios.TSK.instance("HART_TSK").order = 9;
bios.TSK.instance("UI_TSK").destroy();
bios.TSK.create("UI_TSK");
bios.TSK.instance("UI_TSK").arg1 = 0;
bios.TSK.instance("UI_TSK").stackSize = 256;
bios.TSK.instance("UI_TSK").sumformat = "%g inst";
bios.TSK.instance("UI_TSK").fxn = prog.extern("UI_Task");
bios.TSK.instance("UI_TSK").arg5 = 0;
bios.TSK.instance("UI_TSK").allocateTaskName = 0;
bios.TSK.instance("UI_TSK").filtmaxmult = 1;
bios.TSK.instance("UI_TSK").arg2 = 0;
bios.TSK.instance("UI_TSK").avgformat = "%.2f inst";
bios.TSK.instance("UI_TSK").iSTATREG = 0x00000000;
bios.TSK.instance("UI_TSK").iId = 0;
bios.TSK.instance("UI_TSK").autoAllocateStack = 1;
bios.TSK.instance("UI_TSK").arg6 = 0;
bios.TSK.instance("UI_TSK").filtsummult = 1;
bios.TSK.instance("UI_TSK").arg3 = 0;
bios.TSK.instance("UI_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("UI_TSK").order = 3;
bios.TSK.instance("UI_TSK").arg0 = 0;
bios.TSK.instance("UI_TSK").envPointer = 0;
bios.TSK.instance("UI_TSK").arg7 = 0;
bios.TSK.instance("UI_TSK").priority = 6;
bios.TSK.instance("UI_TSK").maxformat = "%g inst";
bios.TSK.instance("UI_TSK").unittype = 0;
bios.TSK.instance("UI_TSK").comment = "User Interface";
bios.TSK.instance("UI_TSK").arg4 = 0;
bios.TSK.instance("UI_TSK").exitFlag = 1;
bios.TSK.instance("UI_TSK").filter = 2;
bios.TSK.instance("HART_TSK").order = 8;
bios.TSK.instance("SYS_TSK").destroy();
bios.TSK.create("EVNT_TSK");
bios.TSK.instance("EVNT_TSK").order = 10;
bios.TSK.instance("EVNT_TSK").fxn = prog.extern("SYS_Task");
bios.TSK.instance("EVNT_TSK").priority = 5;
bios.TSK.instance("EVNT_TSK").comment = "Diagnostic";
bios.TSK.instance("EVNT_TSK").comment = "Events";
bios.TSK.instance("EVNT_TSK").fxn = prog.extern("Event_Task");
bios.TSK.instance("EVNT_TSK").order = 9;
bios.TSK.instance("UI_TSK").destroy();
bios.TSK.create("SYS_TSK");
bios.TSK.instance("SYS_TSK").order = 11;
bios.TSK.instance("SYS_TSK").fxn = prog.extern("UI_Task");
bios.TSK.instance("SYS_TSK").priority = 6;
bios.TSK.instance("SYS_TSK").comment = "User Interface";
bios.TSK.instance("SYS_TSK").fxn = prog.extern("SYS_Task");
bios.MBX.instance("mbxUI").destroy();
bios.MBX.create("mbxSYS");
bios.MBX.instance("mbxSYS").messageSize = 4;
bios.MBX.instance("mbxSYS").length = 8;
bios.TSK.instance("SPI_TSK").order = 5;
bios.TSK.instance("AGC_TSK").order = 6;
bios.TSK.instance("HART_TSK").order = 7;
bios.TSK.instance("EVNT_TSK").order = 8;
bios.TSK.instance("SYS_TSK").order = 9;
bios.TSK.instance("Algo_TSK").destroy();
bios.TSK.create("SIG_TSK");
bios.TSK.instance("SIG_TSK").order = 11;
bios.TSK.instance("SIG_TSK").stackSize = 512;
bios.TSK.instance("SIG_TSK").fxn = prog.extern("SIG_Task");
bios.TSK.instance("SIG_TSK").arg0 = 1000;
bios.TSK.instance("SIG_TSK").priority = 2;
bios.TSK.instance("SIG_TSK").comment = "Signal Processing Task";
bios.MBX.instance("mbxAlgo").destroy();
bios.MBX.create("mbxSIG");
bios.MBX.instance("mbxSIG").length = 2;
bios.TSK.instance("EVNT_TSK").fxn = prog.extern("EVNT_Task");
bios.SEM.instance("semSYS").destroy();
bios.SEM.create("semEVNT");
bios.SEM.instance("semEVNT").count = 1;
bios.MBX.instance("mbxEVNT").destroy();
bios.MBX.instance("mbxSPI").length = 12;
bios.MBX.instance("mbxSPI").length = 10;
bios.MBX.instance("mbxSPI").messageSize = 18;
bios.MBX.instance("mbxSPI").messageSize = 16;
bios.TSK.instance("Modbus_TSK").stackSize = 512;
bios.MEM.instance("L1SARAM").len = 0x1c00;
bios.MEM.instance("L1SARAM").len = 0x1d00;
bios.MEM.instance("L1SARAM").heapSize = 0x0100;
bios.MEM.instance("L1SARAM").len = 0x1b00;
bios.MEM.instance("L1SARAM").heapSize = 0x0200;
bios.TSK.instance("TSK_idle").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("SYS_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("SPI_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("SIG_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("NVM_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("Modbus_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("HART_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("EVNT_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("AGC_TSK").stackMemSeg = prog.get("M0SARAM");
bios.MEM.instance("L1SARAM").len = 0x1d00;
bios.POOL.ENABLEPOOL = 1;
bios.POOL.ENABLEPOOL = 0;
bios.TSK.instance("TSK_idle").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("SYS_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("HART_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("Modbus_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("NVM_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("SIG_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("SPI_TSK").stackMemSeg = prog.get("L1SARAM");
bios.TSK.instance("TSK_idle").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("SYS_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("SPI_TSK").stackMemSeg = prog.get("M0SARAM");
bios.TSK.instance("TSK_idle").stackMemSeg = prog.get("L1SARAM");
bios.MEM.instance("L1SARAM").len = 0x1b00;
bios.TSK.instance("SYS_TSK").stackSize = 512;
bios.TSK.instance("SPI_TSK").stackSize = 256;
bios.TSK.instance("SPI_TSK").priority = 7;
bios.TSK.instance("Modbus_TSK").priority = 9;
bios.TSK.instance("Modbus_TSK").priority = 10;
bios.TSK.instance("NVM_TSK").priority = 6;
bios.TSK.instance("NVM_TSK").priority = 8;
bios.TSK.instance("Modbus_TSK").stackSize = 256;
bios.MEM.instance("FLASH_AB").len = 0x7e80;
bios.MEM.create("CRC_TABLE");
bios.MEM.instance("CRC_TABLE").createHeap = 0;
bios.MEM.instance("CRC_TABLE").base = 0x3f7e80;
bios.MEM.instance("CRC_TABLE").len = 0x0100;
bios.MEM.instance("CRC_TABLE").space = "code";
// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!
if (config.hasReportedError == false) {
prog.gen();
}
Hi Zaw,
I think what you're doing should work. I tried a very simple example for F28069, carving out a chunk of FLASH for CRC_TABLE as follows:
bios.FLASH.len = 0x1f000; // decrease FLASH size to make space for CRC_TABLE
print("bios.FLASH.len = " + utils.toHex(bios.FLASH.len));
bios.MEM.create("CRC_TABLE");
bios.MEM.instance("CRC_TABLE").createHeap = 0;
bios.MEM.instance("CRC_TABLE").base = bios.FLASH.base + bios.FLASH.len;
bios.MEM.instance("CRC_TABLE").len = 0xff0;
bios.MEM.instance("CRC_TABLE").space = "code";
The new memory region shows up in the generated linker command file:
MEMORY {
PAGE 1: PIEVECT: origin = 0xd00, len = 0x100
PAGE 1: MSARAM: origin = 0x0, len = 0x800
PAGE 0: L03DPSARAM: origin = 0x8000, len = 0x2000
PAGE 0: L4SARAM: origin = 0xa000, len = 0x2000
PAGE 0: L56DPSARAM: origin = 0xc000, len = 0x4000
PAGE 0: L78DPSARAM: origin = 0x10000, len = 0x3000
PAGE 0: OTP: origin = 0x3d7800, len = 0x3fa
PAGE 0: FLASH: origin = 0x3d8000, len = 0x1f000
PAGE 0: BOOTROM: origin = 0x3f8000, len = 0x7fc0
PAGE 0: CRC_TABLE: origin = 0x3f7000, len = 0xff0
}
You might try simplifying your program (and .tcf file), just to get the memory regions correct first. Are you getting a build error?
Best regards,
Janet
Hi Zaw,
The cfg.cmd file is auto-generated from the .tcf file. You may see something like this message at the top of the file:
/* Do *not* directly modify this file. It was */
/* generated by the Configuration Tool; any */
/* changes risk being overwritten. */
So adding the CRC_TABLE into the generated .cfg file is probably not what you want to do. What version of CCS are you using? Can you start with one of the DSP/BIOS example projects and see if you can change the memory there?
Thanks,
Janet
Hi Zaw,
I tried importing and building a DSP/BIOS program in CCS7.0. You can import the example project by selecting:
File -> New -> CCS Project
Select the target (I chose 2806x Piccolo since I have that device), the target connection, and choose a name for your project. Expand the "DSP/BIOS v5.xx Examples" in the "Project templates and examples", and choose one: