I'm currently going through some old code for a system here and a small change to the USART driver, I noticed that the array being used as a FIFO buffer for the USART started clobbering other variables. These arrays are declared outside all methods as
static char uartRxFIFOSpace[UART_RX_FIFO_LENGTH]; static char uartTxFIFOSpace[UART_TX_FIFO_LENGTH];
where UART_RX_FIFO_LENGTH and UART_TX_FIFO_LENGTH is #defined a few lines before as, in this case, 0x80.
In an attempt to check which variables this array was likely to clobber, I checked the .map file generated but there wasn't a listing for these variables at all. Removing the static keyword not only made the variable appear in the .map file but also fixed the problem.
I thought I knew what the static keyword did but I didn't think it would change anything in this situation, especially not whether the symbol would appear in the .map file! Any more info on what exactly the static keyword does and why it would change things in this situation would be great, cheers!
Oh yeah, the thing I changed in order to get the code to stop working in the first place was to change the #define of UART_RX_FIFO_LENGTH from 0x3f to 0x80.