Monday, April 23rd 2018, 5:40am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Tolaemon

Beginner

Date of registration: Jun 16th 2010

Posts: 1

1

Wednesday, June 16th 2010, 1:05pm

Cuestion about OS_EnterInterrupt() and OS_EnterNestableInterrupt() ...

Hi. I'm working on a project which makes use of "embOS for M32C and Renesas NC308 compiler" and I've found a bug in my firmware I should solve. The device that I'm programming is an RS-232/RS-485 comunications concentrator, and the problem ocurs when there is high communications throughput. In this situation, some times, the concentrator looses some bytes in one of it's UARTs, and this slows down the communications process due to communication retries.

I have carefully checked the firmware and have realized that the problem is due to the fact that these "lost bytes" are not received in the interrupt routine, maybe because the processor is busy executing another interrupt. So maybe the problem is that some UART interrupts are lost when the system is busy on other interrupt.

I've cheked our OS docuemntation and have found that exists a function named OS_EnterNestableINterrupt() which I'think could solve the problem reenabling the interruptions while another interrupt is being executed. The ISR function is:

Source code

1
2
3
4
5
6
7
8
9
void OS_ISR_Recepcion_VIA_2 (void){
   unsigned char Data;

   OS_EnterInterrupt();
   Data = (unsigned char) U2RB; 
   OS_PutMailCond1(&Cola_Recepcion_VIA_2, &Data);
   OS_LeaveInterrupt();

}


My cuestion is: would be right replace OS_EnterInterrupt(); with OS_EnterNEstableInterrupt?

Thanks in advance!

Jordi

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 266

2

Thursday, June 17th 2010, 5:22pm

Hello Jordi,

you can use OS_EnterNestableInterrupt()/OS_LeaveNestableInterrupt() to have nestable interrupts which means that an interrupt routine can be interrupted by another interrupt routine. But I can't know if this solves your problem, if your cpu is to busy this will not help. You should check which parts and interrupt routines of your application needs how much cpu time and decide then which interrupt routine gets a higher interrupt priority.

Regards,
Til

Vincent

Beginner

Date of registration: Dec 21st 2012

Posts: 14

3

Monday, September 23rd 2013, 9:07pm

Hello Jordi,

Could you tell me if the usage of the Nestable interrupt solve your problem of characters loss ?