Re: pic32mz uart whitout harmony
"unsigned char *buf;"
is a pointer, not an area of storage, and it is not initialized in that statement.
If the pointer is not initialized to a valid memory address somewhere else,
it will point to memory address 0 which is deliberately Not accessible,
just to catch that kind of mistakes,
so the memory access will take exception for trying to access a prohibited address in memory,
and reset the processor.