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.

EVMK2GX: Cannot download RTOS app to EVMK2G board.

Part Number: EVMK2GX
Other Parts Discussed in Thread: SYSBIOS

I installed CCS10.02 but I cannot find RTOS template application from C:\ti\processor_sdk_rtos_k2g_6_03_00_106\demos

Then I create simple rtos application by CCS project wizard.

Here is C code:

/*
* ======== main.c ========
*/

#include <xdc/std.h>

#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>

/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");

Task_sleep(10);

System_printf("exit taskFxn()\n");

System_flush(); /* force SysMin output to console */
}

/*
* ======== main ========
*/
Int main()
{
Task_Handle task;
Error_Block eb;

System_printf("enter main()\n");

Error_init(&eb);
task = Task_create(taskFxn, NULL, &eb);
if (task == NULL) {
System_printf("Task_create() failed!\n");
BIOS_exit(0);
}

BIOS_start(); /* does not return */
return(0);
}

Here is cfg file

var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

/*
* Uncomment this line to globally disable Asserts.
* All modules inherit the default from the 'Defaults' module. You
* can override these defaults on a per-module basis using Module.common$.
* Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
*/

/*
* Uncomment this line to keep module names from being loaded on the target.
* The module name strings are placed in the .const section. Setting this
* parameter to false will save space in the .const section. Error and
* Assert messages will contain an "unknown module" prefix instead
* of the actual module name.
Defaults.common$.namedModule = false;
*/

/*
* Minimize exit handler array in System. The System module includes
* an array of functions that are registered with System_atexit() to be
* called by System_exit().
*/
System.maxAtexitHandlers = 4;

/*
* Uncomment this line to disable the Error print function.
* We lose error information when this is disabled since the errors are
* not printed. Disabling the raiseHook will save some code space if
* your app is not using System_printf() since the Error_print() function
* calls System_printf().
Error.raiseHook = null;
*/

/*
* Uncomment this line to keep Error, Assert, and Log strings from being
* loaded on the target. These strings are placed in the .const section.
* Setting this parameter to false will save space in the .const section.
* Error, Assert and Log message will print raw ids and args instead of
* a formatted message.
Text.isLoaded = false;
*/

/*
* Uncomment this line to disable the output of characters by SysMin
* when the program exits. SysMin writes characters to a circular buffer.
* This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
*/

/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
BIOS.heapSize = 0x1000;

/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Custom;

/* System stack size (used by ISRs and Swis) */
Program.stack = 0x2000;

/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;

/*
* Create and install logger for the whole system
*/
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 16;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;

System.SupportProxy = SysMin;

########################################################################

I can success build project without error, here is build log

**** Build of configuration Debug for project armBIOS1 ****

"C:\\ti\\ccs1020\\ccs\\utils\\bin\\gmake" -k -j 4 all -O

making ../src/sysbios/sysbios.aa15fg ...
Building file: "../app.cfg"
Invoking: XDCtools
"C:/ti/ccs1020/xdctools_3_62_00_08_core/xs" --xdcpath="C:/ti/bios_6_76_03_01/packages;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A15F -p ti.platforms.evmTCI66AK2G02 -r release -c "C:/ti/ccs1020/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32" "../app.cfg"
gmake[1]: Nothing to be done for 'all'.
Finished building: "../app.cfg"

Building file: "../main.c"
Invoking: GNU Compiler
"C:/ti/ccs1020/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dk2g02 -Darm0 -I"C:/Users/cctv/workspace_v10/armBIOS1" -I"C:/ti/bios_6_76_03_01/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/newlib-nano" -I"C:/ti/bios_6_76_03_01/packages/ti/posix/gcc" -I"C:/ti/ccs1020/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"main.d" -MT"main.o" -std=c99 @"configPkg/compiler.opt" -o"main.o" "../main.c"
Finished building: "../main.c"

making ../src/sysbios/sysbios.aa15fg ...
gmake[2]: Nothing to be done for 'all'.
Building target: "armBIOS1.out"
Invoking: GNU Linker
"C:/ti/ccs1020/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe" -mtune=cortex-a15 -marm -Dk2g02 -Darm0 -Og -g -gdwarf-3 -gstrict-dwarf -Wall -mfloat-abi=hard -Wl,-Map,"armBIOS1.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_76_03_01/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard" -Wl,--defsym,ARM_CORE=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 --specs=nano.specs -o"armBIOS1.out" "./main.o" -Wl,-T"../66AK2Gxx.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lgcc -lm -lnosys -lc -Wl,--end-group
Finished building target: "armBIOS1.out"

**** Build Finished ****

But I cannot connect to target K2G board, with below error

CortexA15: Trouble Writing Memory Block at 0x80000000 on Page 0 of Length 0x7ff0: This operation is not supported by this driver
CortexA15: File Loader: Verification failed: Target failed to write 0x80000000
CortexA15: GEL: File: C:\Users\cctv\workspace_v10\miniARM1\Debug\miniARM1.out: Load failed.

CortexA15: Error connecting to the target: (Error -6311) PRSC module failed to write to a register. (Emulation package 9.3.0.00032) 

CortexA15: Trouble Halting Target CPU: (Error -1321 @ 0x0) Device failed to enter debug/halt mode because security settings prevent debug. Power-cycle the board. If error persists, confirm configuration and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00032)
CortexA15: GEL: Target must be connected before calling the function