Hello David,
I think I need to make a couple of additional comments -
The inbuf[] array variable will likely need to be allocated as a global variable, rather than a local variable on the stack. This is required so that writing to the buffer, and the reading of the buffer contents can be handled by two separate functions, with both having access to the buffer. Ultimately, the buffer write process could be handled by an ISR.
If you are programming in C, reducing the allocated stack size ia probably not a good idea. While your program may compile and link without error, during normal operation of the program, the stack may attempt to over-write the global variables anyway. This type of bug may be very difficult to diagnose.
So it is a very good idea to keep the global variables, including the buffer, well separated from the stack. With the default PRM settings, Z_RAM segment does not get used for anything, but this would seem the obvious place to locate the globals.
Regards.
Mac