We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Good afternoon,
I'm trying to register a serial (com-0) interrupt using uVision 3 on the Cypress FX2LP. The code compiles fine, but the linker warns:
WARNING L16: UNCALLED SEGMENT, IGNORED OVERLAY PROCESS SEGMENT: ?PR?COM_ISR?MAIN
My ISR looks like this:
static void com_isr (void) interrupt 4 { char c; if (RI) { c = SBUF0; // read character RI = 0; // clear interrupt request flag if (istart + ILEN != iend) { inbuf[iend++ & (ILEN-1)] = c; } } if (TI != 0) { TI = 0; // clear interrupt request flag if (ostart != oend) { // if characters in buffer and SBUF0 = outbuf[ostart++ & (OLEN-1)]; // transmit character sendfull = 0; } else { // if all characters transmitted sendactive = 0; // clear 'sendactive' } } }
This code is pretty much copy and pasted from the Keil Help section on Serial Transmission.
This ISR is not being called, even with IE=0x80 (to enable global interrupts) and ES0 = 1 (to enable serial 0 interrupts). Does anyone have any suggestions?
Thanks,
Montana
I don't think Keil cares - but it certainly doesn't need it!
I tried removing static - that didn't work. I also tried adding a method prototype - with no result.
I've changed the method header to
void com_isr(void)
and I have changed my putchar and getchar methods to run com_isr() until the buffers are empty. I also have
while (TI == 1 || RI == 1) com_isr();
I've disabled interrupts for the time being. This works for my application, but is a dirty trick to use (and is a bit concerning, since I could miss some received data if my processor is off doing something and doesn't call com_isr() as often as it should). Luckily sending the data is much more important than receiving (receive is just an ACK, and I haven't lost one yet since the processor doesn't do much else).
I'll post back here if I ever resolve the issue ... unfortunately I must move on.
Thanks for the suggestions,
void com_isr (void) interrupt 4 {
every Keil user has such working did you retype and 'skip' an error in the code?
Erik
You haven't set the option to disable vector table generation, have you...?
I think you got it, noiv will definetely do it if the vector is not set in assembler (I guess that would be the only way to do it manually)
I have used noiv for bootloader/app switch, but see no other use - any takers?