Hi,
I tried all the things to create a hwi for UART of EVM6678 but I failed yet.
From some articles here, I adopted many lines to try it.
Following code is what I tried finally.
-----------------------------------------------------------------------------
int UART_init(void)
{
Hwi_Params UART_Hwi_params;
Int hostInt, sysInt;
int eventId;
Error_Block eb;
// platform_uart_init();
// (void) platform_write_configure(PLATFORM_WRITE_ALL);
hUartRegs->PWREMU_MGMT = 0x0;
(void) platform_uart_set_baudrate(115200);
hUartRegs->IER=0x01;
hUartRegs->MCR = 0;
hUartRegs->FCR = 0x7;
hUartRegs->PWREMU_MGMT = 0x6001;
sysInt = 148;
hostInt = 32;
eventId = CpIntc_getEventId(hostInt);
Hwi_Params_init(&UART_Hwi_params);
UART_Hwi_params.arg = hostInt;
UART_Hwi_params.eventId = eventId;
UART_Hwi_params.enableInt = TRUE;
UART_Hwi_params.priority = 2;
UART_Hwi_params.maskSetting = Hwi_MaskingOption_ALL;
UART_Hwi_Handle = Hwi_create(5, UART_Rx_hwi, &UART_Hwi_params, &eb);
an_error = Error_getMsg(&eb);
// platform_write("UART_Hwi_Handle = %d\n",UART_Hwi_Handle);
// Hwi_enableInterrupt(5);
// Hwi_enable();
/*
* plug CpIntc dispatch table with 'UART_Rx_hwi'.
* set 'unmask' to 'TRUE' to enable the system interrupt.
*/
CpIntc_disableHostInt(0, hostInt);
CpIntc_disableSysInt(0, sysInt);
CpIntc_clearSysInt(0, sysInt);
CpIntc_mapSysIntToHostInt(0, sysInt, hostInt);
CpIntc_dispatchPlug(sysInt, UART_Rx_hwi, sysInt, TRUE);
CpIntc_enableHostInt(0, hostInt);
CpIntc_enableSysInt(0, sysInt);
return 1;
}
-----------------------------------------------------------------------------
But when I printed the "an_error" in EVM_init() It was read as. -- platform_write(an_error);
out of memory: heap=0xb, size=36123
In my .cfg file,
-----------------------------------------------------------------------------
var Memory = xdc.useModule('xdc.runtime.Memory');
var Startup = xdc.useModule('xdc.runtime.Startup');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
Clock.tickPeriod = 2000;
//in usec
BIOS.heapSize = 65536;
var Task = xdc.useModule('ti.sysbios.knl.Task');
/* Configure the Modules */
BIOS.taskEnabled = true;
/* Create our memory map - i.e. this is equivalent to linker.cmd */
Program.sectMap[".const"] = "DDR3";
Program.sectMap[".text"] = "DDR3";
Program.sectMap[".code"] = "DDR3";
Program.sectMap[".data"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap["platform_lib"] = "DDR3";
/* Lets register any hooks, tasks, etc that we want BIOS to handle
** Register an EVM Init handler with BIOS. This will initialize the ** hardware.
** BIOS calls before it starts.
*/
Startup.firstFxns.$add('&EVM_init');
-----------------------------------------------------------------------------
I call UART_init() in the EVM_init() and it is the first thing in the EVM_init();
What is the meaning of "out of memory: heap=0xb, size=36123"?
and How to fix it?
James