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.

Hwi_create on msp430 doesn't instantiate

Other Parts Discussed in Thread: MSP430F5438, SYSBIOS
Hi,
I am working on SYSBIOS 6.32.5.54 , CCS 5.1.1.00031 and using a MSP430F5438 uprocessor.
I am new on Sysbios programming so maybe I am doing a common mistake.
My trouble is that I'm trying to dynamically create an Hwi which will take care of one serial input port with the following code.
When the code reach the Hwi_create(..), precisely in file app_p430X.c at

/* module-specific initialization */
iStat = ti_sysbios_family_msp430_Hwi_Instance_init__F(obj, args->intNum, args->hwiFxn, &prms, eb);

I get the Console error reported below and the execution stops.
Initially I had a stack size problem, but now I think it is fixed but still not work.
Any suggestion of what I can do to fix it will be very appreciate!
Andrea.

Code executed:

char UART3_received_char;
Swi_Handle swi0_buffer_uart3;
Hwi_Handle hwi0_UART3;

void receiver_init()
{ Error_Block eb;
Error_init(&eb);

Swi_Params swi0Params;
Swi_Params_init(&swi0Params);
//swi0Params.instance->name = "swi0_buffer_uart3";
swi0Params.priority = 14;
swi0_buffer_uart3 = Swi_create((Swi_FuncPtr)save_in_uart3_buffer, &swi0Params, &eb);
if(swi0_buffer_uart3==NULL)
{return;}

Hwi_Params hwi0USBParams;
Hwi_Params_init(&hwi0USBParams);
//hwi0USBParams.instance->name = "hwi0_UART3";

hwi0USBParams.maskSetting = ti_sysbios_interfaces_IHwi_MaskingOption_ALL;
hwi0USBParams.priority= 0;
Error_init(&eb);

hwi0_UART3 = Hwi_create(44, (Hwi_FuncPtr)Uart3_Hwi_handler, &hwi0USBParams, &eb);
if(hwi0_UART3==NULL)
{return;}
}



void Uart3_Hwi_handler(void)
{
UART3_received_char=UCA3RXBUF;
Swi_post((Swi_Handle)swi0_buffer_uart3);
//Swi_post(save_in_uart3_buffer);

#ifdef ECHO
UART3_Transmit(UART3_received_char);
#endif
}

char uart3_buffer[BUFFER_SIZE];
unsigned int write_uart3_buffer=0;

char is_entered=4;

void save_in_uart3_buffer(void)
{
/* uart3_buffer[write_uart3_buffer]=UART3_received_char;
write_uart3_buffer++;
if(write_uart3_buffer>=BUFFER_SIZE)
write_uart3_buffer=0;*/
is_entered=1;
}

Void main()
{
Led_Init();
Led1_On();
P11DIR = P11DIR | 0x02 | 0x04 |0x01 ; //set P11.1 & P11.2 as output
P11SEL = P11SEL | 0x02 | 0x04 |0x01 ; //set P11.1 & P11.2 as MCLK/SMCLK/aclk function

UART3_Init(ACLK, 9600);//function that configure baudrate

USB_receiver_init();
BIOS_start(); /* enable interrupts and start SYS/BIOS */

}

This is the Error I get on my Console:

ti.sysbios.family.msp430.Hwi: line 210: E_notImplemented: Function not implemented: Hwi_create
xdc.runtime.Error.raise: terminating execution


Application Configuration 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.family.msp430.Hwi');
var Agent = xdc.useModule('ti.sysbios.rta.Agent');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var Idle = xdc.useModule('ti.sysbios.knl.Idle');

//var ClockFreqs = xdc.useModule('ti.sysbios.family.msp430.ClockFreqs'); //ce l'ho aggiunta io
/*
* Program.argSize sets the size of the .args section.
* The examples don't use command line args so argSize is set to 0.
*/
Program.argSize = 0x0;

/*
* 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 = 4096;

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

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

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

System.SupportProxy = SysMin;
Clock.tickPeriod = 1000000;
Clock.tickSource = Clock.TickSource_TIMER;
Agent.sysbiosSwiLogging = true;
Hwi.common$.namedInstance = false;
BIOS.taskEnabled = true;
BIOS.swiEnabled = true;
BIOS.clockEnabled = true;