I am using the C6678. I want to use SYSBIOS to set up a HWI with the UART receive event, which in the Data Manual says has an event # 149. When I try to use this event Id in the SYSBios, I get the error "eventId (149) must be less than 128". What am I doing wrong?
Mike
CpIntc_mapSysIntToHostInt(0, 148, 32);
CpIntc_dispatchPlug(148, myrxint, 148, TRUE);
CpIntc_enableHostInt(0, 32);
eventId = CpIntc_getEventId(32);
Hwi_Params_init(¶ms);
params.arg = 32;
params.eventId = eventId;
params.enableInt = TRUE;
params.priority = 2;
Hwi_create(5, &CpIntc_dispatch, ¶ms, NULL);
Hwi_enableInterrupt(5);
Hwi_enable();
This is wahat I did for a uart receive interrupt. Worked pretty well. Close to what you have though, so I'm not sure whats wrong.
Hey Michael,
Yep that is where I got it from. I was not getting the interrupt to fire, and I was not getting any help anywhere else so I thought I would post what I have here and see if I got any bites... I am sure I am missing something... And I have no idea what it is... I will recompile with your code. Can you post the myrxint method that you have maybe there is something in there, although when I set the breakpoint I never get to it..??
I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly. Gotta love TI Support.
The actual answer: You have to do the above to connect the peripheral interrupt via SysBios to the Callback routines (6 separate function calls? Really? I thought this was supposed to make development easier!). However, that is not enough. You also need to use CSL to set up the peripheral itself to generate interrupts. The SysBios setup does absolutely nothing to the peripheral.
// Force the Transmitter and Receiver into reset mode before init hUartRegs->PWREMU_MGMT = CSL_UART_PWREMU_MGMT_RESETVAL; platform_uart_init(); platform_uart_set_baudrate(115200); //FCR- Fifo control reg - Enable fifos, disable DMA, Set Fifo trigger to 8 chars CSL_FINS (hUartRegs->FCR, UART_FCR_FIFOEN, CSL_UART_FCR_FIFOEN_ENABLE); CSL_FINS (hUartRegs->FCR, UART_FCR_TXCLR, CSL_UART_FCR_TXCLR_CLR); CSL_FINS (hUartRegs->FCR, UART_FCR_RXCLR, CSL_UART_FCR_RXCLR_CLR); CSL_FINS (hUartRegs->FCR, UART_FCR_DMAMODE1, CSL_UART_FCR_DMAMODE1_DISABLE); CSL_FINS (hUartRegs->FCR, UART_FCR_RXFIFTL, CSL_UART_FCR_RXFIFTL_CHAR8); // UART.IER Interrupt Enable Register // ERBI for Data Ready and Fifo trigger including timeout // ELSI for overrun, parity, framing errs // ETBEI for Transmitter empty interrupt hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK); //hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK + CSL_UART_IER_ETBEI_MASK);
I'm glad you were able to add to this thread.
Regarding this comment: "I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly. Gotta love TI Support. "
If you scroll back in the thread, I think you'll notice that the question was marked Verified by the original author of the post.
Alan
Hi jonathan,
I have a same question.
I try two type code,but it didn`t call my interrupt sever routine.
My code is here:
CpIntc_dispatchPlug(148, (CpIntc_FuncPtr)myrxint, NULL, TRUE);
/*CpIntc_dispatchPlug(CSL_INTC0_UARTINT, (CpIntc_FuncPtr)myrxint, NULL, TRUE);//后添加
CpIntc_mapSysIntToHostInt(0, CSL_INTC0_UARTINT, 32);//后添加
CpIntc_enableHostInt(0, 32);//后添加
CpIntc_enableSysInt(0, CSL_INTC0_UARTINT);//后添加
eventId = CpIntc_getEventId(32);//后添加
EventCombiner_dispatchPlug (eventId, CpIntc_dispatch, 32, TRUE);//后添加*/
Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.
Hi,judahvang
I try to use http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/355/2664.tests.zip.But the interrupt routine not be called.
Use 6678.
My code like this:
void idl0Fxn(void){
CpIntc_postSysInt(0, 15);
}
void event15Fxn(){ event15Done = TRUE;}
void main(){ Hwi_Params params; Int eventId;
printf("Running LX_uart\n");
UartInit();
CpIntc_mapSysIntToHostInt(0, 15, 8);
CpIntc_dispatchPlug(15, (CpIntc_FuncPtr)&event15Fxn, 15, TRUE);
CpIntc_enableHostInt(0, 8);
eventId = CpIntc_getEventId(8);
params.arg = 8;
params.priority = 6;
// CpIntc_enableSysInt(0,15);
// Hwi_enableInterrupt(5);
// Hwi_enable();
printf("main compelet\n"); BIOS_start();
please tell me why?
Thanks
LI
Li,
Were you able to get any of the SYS/BIOS examples to work?
Todd
HI,
Thank for your reply.
I got some examples ( which from e2e forums)and coding like these,but i`m not sure the code is right.
I have read SYS/BIOS 6.32.05.54 GA Release Notes and anything i can get.
I think that I have understood c66 interrupt and uart init,but the code is still not OK.
Can you give me some suggestion or example? And Please tell me where is wrong in my code?
Thanks,
Li
Hi todd,
I want to use FIFO-interrupt mode of UART receiver.
Uart system interrupt id is 148.so i code like this:
CpIntc_mapSysIntToHostInt(0, 148, 32);//core 0
But i found when i called "eventId = CpIntc_getEventId(32);"
the eventId is 255,i think it`s wrong.but did`t know why?
My code is following:
Thanks Todd
First can you please verify that you can get any of the SYS/BIOS examples (e.g. Task Mutex) to work.
Hi Todd,
Yes,I can. Yesterday,I have resolved the problem with API eventcombiner.
I have some question:
Q1:What is the different between eventcombiner (to map hwi) and Hwi create(to map hwi).
Q2:If I want to use Hwi create,How to use it correctly.I have try many times but still failed.
Q3:The question about
CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE);
if I use it like this, it looks like wrong.
But if i use like the folllowing:(event15Fxn the function is void return)
CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);
It is right.
I have read
Sorry , I try to use CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE) and CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);
The both all right.
But used Hwi_create to create a hwi still failed.
I used CpIntc_postSysInt for test.But not to work(it meant the hwi create failed)
I have another question today:
I continually send data from PC,Mostly it can call interrupt routine only once.
The reason is about BIOS or UART or CPU?
Can you start a new post when you have a new question? It makes it easier to answer the question and for other forum users to search and find answers.
Sorry, I start a new post last week. But nobody answer me. Thank you.
I will start a new post again.