pic32 debug char pointer declaration
You are having this problem because you are attempting to modify buffer which you defined as pointer to char, or rather point to a string literal. You cannot modify this. You should use:

unsigned char buffer[]="efg";


instead. For more information, check out this post: Char array vs Char Pointer in C