cof_serXgetc returns before getting a char

Sample Cof_EchoChr.C runs fine for me.
However, if I create sub-cofunc, like

cofunc void echochar(void) {
int c;
wfd c = cof_serDgetc();
wfd cof_serDputc(c);
}

and substitute the original calls from the costate to the wfd echochar();

things stop work. In particular, the program starts outputting characters to the serial port without waiting for the input. debug shows that cof_serDgetc() aborts without waiting for the input and returns -1;

why?