I'm working on TS7200 Board and would like to use the COM2 in RS485
mode in Hard Real Time. It's not possible to use controls such as
ioctl() since it refers to linux fonctions. How can i do?
My idea is to build my own UART2 IRQ handler in user mode.
**********************************************************
So, I've created a thread used for my IRQ:
pthread_create(&RS485_thread_handler,attr,(void *(*)(void
*))RS485_IRQ_Handler_Code,NULL);
The code related to the RS485_IRQ_Handler_Code() Function is the
following one:
void *RS485_IRQ_Handler_Code(void *arg)
{
int ovr = 0;
RS485_Task =
rt_task_init_schmod(nam2num("RS485"),2,1000,0,SCHED_FIFO,0xFF);
rt_allow_nonroot_hrt();
mlockall(MCL_CURRENT | MCL_FUTURE);
rt_make_hard_real_time();
rt_request_irq_task(UART2_IRQ,RS485_Task,RT_IRQ_TASK,1);
rt_startup_irq(UART2_IRQ);
rt_enable_irq(UART2_IRQ);
while(OK)
{
do {
ovr = rt_irq_wait(UART2_IRQ);
if (ovr == RT_IRQ_TASK_ERR)
break;
rt_printk("IRQ!!");
rt_ack_irq(UART2_IRQ);
} while (ovr > 0);
rt_pend_linux_irq(UART2_IRQ);
}
rt_release_irq_task(UART2_IRQ);
rt_make_soft_real_time();
rt_task_delete(Task_1);
return 0;
}
where UART2_IRQ is the VIC Interrupt Source for UART2 Interrupt: 54
I have the message, "<3>RTAI[hal]: rt_enable_irq(54) unbalanced from
c60a1890" when running program. What does it means?
**********************************************************
In order to build my own IRQ handler, I attempt to modify some
register's values such as UART2RXSts, UART2LinCtrlHigh, ...
It created a Segmentation Fault when program running! Are these
registers locked? Should these registers be modified when system
starting? And how can I modify them ??
**********************************************************
Did I choose the right way? How can I do differently?
Thank you for your help !!!
Julien
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|