This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linker Warning

Greetings,

Within my serial receive interrupt routine I'm getting a linker warning dealing with a printf statement.

My code and the warning are shown below:

void
serial_int() interrupt 4
{ if(RI == 1)
{

serial_data = SBUF0;

// printf("data read = \n"); printf("data read = %x\n",serial_data);
} RI = 0;
}

The warning:

WARNING L15: Multiple Call To Segment
SEGMENT: ? PR?PRINTF?PRINTF
CALLER1: ?PR?SERIAL_INT?

Why is the printf statement generating a warning?

Thanks
Sparky_
Thanks

Parents
  • I'm going to ignore your linker warning and talk about something else.

    Using printf() in an interrupt handler is seldom a good idea. On one hand, printf() is slow, which means that each interrupt will be slow, leaving little time for the main application.

    Next problem is that printf() needs quite much resources.

    Third problem is that printf() may not be written to be reentrant, i.e. support that you get an interrupt that calls printf() while the main loop is currently busy with another call to printf().

Reply
  • I'm going to ignore your linker warning and talk about something else.

    Using printf() in an interrupt handler is seldom a good idea. On one hand, printf() is slow, which means that each interrupt will be slow, leaving little time for the main application.

    Next problem is that printf() needs quite much resources.

    Third problem is that printf() may not be written to be reentrant, i.e. support that you get an interrupt that calls printf() while the main loop is currently busy with another call to printf().

Children
No data