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
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
Try making your function reentrent. This fixed a similar problem for me. AC
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
"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...?
"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); }