Right. The book is set in the Scottish Boarders and the hero is a lawyer who goes back in disgrace to his village. He solves a murder and helps acquit a young man of murder.
I think James I is on the throne and one of the subplots involves a man being accused of being a spy because he is making a map of the Scottish coastline.
It was the first in a series but I have forgotten the author who I remember at least was male.
The protagonist has a friend in the village who is an apothecary and its his apprentice who is accused of murder.
I read it about 5 years ago.
For anyone who can help.