Tool/software: TI-RTOS
I am developing mailbox communication between DSP and PRU on AM5728IDK. In theory, PRU program is user1 of mailbox2, configure mailbox2 and send a message to queue0 of mailbox2. And DSP program is user0 of mailbox2, receive a interrupt and read the message from queue0 of mailbox2. But when the DSP program received a interrupt, it hangs in Hwi_unPluggedInterrupt().
There are the DSP program snippet:
Int main()
{
Task_Handle task;
Error_Block eb;
Hwi_Params params;
IntXbar_connectIRQ(43, 237);
EventCombiner_dispatchPlug(43, &myEvent43Fxn, 43, TRUE);
EventCombiner_enableEvent(43);
Hwi_Params_init(¶ms);
params.eventId = 43/32 ;
params.arg = params.eventId;
params.maskSetting = Hwi_MaskingOption_SELF;
params.enableInt = TRUE;
Hwi_create(7, mailbox_ISR, ¶ms, &eb);
System_printf("DSP:enter main()\n");
System_flush();
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);
}
void mailbox_ISR(UArg arg)
{
gMsgStatus = MailboxGetMessage(MAILBOX_BASE_ADDRESS, MAILBOX_QUEUE_0,
(uint32_t *) &gMsg);
MailboxClrNewMsgStatus(MAILBOX_BASE_ADDRESS, MAILBOX_USER, MAILBOX_QUEUE_0);
}
Void taskFxn(UArg a0, UArg a1)
{
System_printf("DSP:enter taskFxn()\n");
System_flush();
int i = 0;
Hwi_enableInterrupt(7);
Hwi_enable();
Hwi_startup();
...
}
environment:
CCS 6.2
TI-RTOS:ti-processor-sdk-rtos-am57xx-evm-04.00.00.04
I don't know how to debug the Hwi and interrupt. Please give me some guides.
Thank you.