Keil™, An ARM® Company

Discussion Forum

MULTIPLE CALL TO SEGMENT

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
joe man
Posted
26-Apr-2004 15:46 GMT
Toolset
C51
New! MULTIPLE CALL TO SEGMENT
Hi All,
I've a warning message : MULTIPLE CALL TO SEGMENT L15
The problem comes from 2 different ISRs that call the same function.
What I dont understand is that both callers are ISRs and therfore the called function will not be called at the same time.
I use keil 7.07 for an2131 cypress (ezusb),
here is my code :

#pragma NOAREGS

static void Check_Data_Received(unsigned char data_received)
{
...
MIDI_In_Add_Buffer(data_received, &MIDI_In_From_Con);
...
}

static void MIDI_In_Add_Buffer(unsigned char data_in, Midi_In_Struct *midi_struct)
{
...
}

#pragma AREGS

static void serial_port_0_isr (void) interrupt COM0_VECT using 1
{
BYTE data_received;
...
Check_Data_Received(data_received);
...
}

void ISR_Ep2out(void) interrupt 0
{
..
MIDI_In_Add_Buffer(OUT2BUF[index+frame+1], &MIDI_In_From_Usb);
}

The warning is as follow :

*** WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_MIDI_IN_ADD_BUFFER?ITR
CALLER1: ?PR?SERIAL_PORT_0_ISR?ITR
CALLER2: ?PR?USB_JUMP_TABLE?USBJT

Any help greatly appreciated
Read-Only
Author
Jon Ward
Posted
26-Apr-2004 15:55 GMT
Toolset
C51
New! RE: MULTIPLE CALL TO SEGMENT
Take a look at the following knowledgebase article:

http://www.keil.com/support/docs/805.htm

It addresses this issue and gives several suggestions.

Jon
Read-Only
Author
Andy Curda
Posted
26-Apr-2004 19:32 GMT
Toolset
C51
New! RE: MULTIPLE CALL TO SEGMENT
Try making your function reentrent. This fixed a similar problem for me.

AC
Read-Only
Author
erik malund
Posted
26-Apr-2004 20:38 GMT
Toolset
C51
New! RE: MULTIPLE CALL TO SEGMENT
What I dont understand is that both callers are ISRs and therfore the called function will not be called at the same time.

True only if both ISRs are same priority.

You expect the linker to find and analyze all occurences of IP (and its multitude of expansions IP1, EIP etc) and based on that decide if there is any possibility of one ISR calling when the subroutine is processing a call from another ISR. That is asking the linker to be a bit more than it could ever be. For one, to do this the linker would need to be drivative aware.

Erik
Read-Only
Author
Andrew Neil
Posted
26-Apr-2004 21:55 GMT
Toolset
C51
New! RE: MULTIPLE CALL TO SEGMENT
"both callers are ISRs and therfore the called function will not be called at the same time."

Remember, it's only a Warning; the Linker is just telling you that it is not certain that it's safe - but that doesn't necessarily mean that it is unsafe in your particular application.

If you are absolutely 101% completely & totally sure of that (see Erik's note), then you're OK, aren't you...?
Read-Only
Author
Stefan Duncanson
Posted
27-Apr-2004 13:59 GMT
Toolset
C51
New! RE: MULTIPLE CALL TO SEGMENT
"What I dont understand is that both callers are ISRs"

No they're not. Check_Data_Received() is not an ISR:

static void Check_Data_Received(unsigned char data_received)
{
...
MIDI_In_Add_Buffer(data_received, &MIDI_In_From_Con);
...
}

Whereas this one is:

void ISR_Ep2out(void) interrupt 0
{
..
MIDI_In_Add_Buffer(OUT2BUF[index+frame+1], &MIDI_In_From_Usb);
}

Next Thread | Thread List | Previous Thread Start a Thread | Settings