There are libraries/functions for the AVRs but I don't know if they have been ported to the SAM.
A quick and dirty way is to malloc() a single byte and get it's address, subtract that value from the max RAM address then subtract a fudge factor for the stack.
On LPCs you can get the SP as well and that's probably a option on the SAM, but you could also call a dummy function and get the address of a local variable to get an approx stack value. Or for that matter get the address of a local var in loop().
______
Rob