In case you have kernel 4.9.4+ and you might need to use GPIO fucntions, sudenly you’ll receive an error message like the one described below:
wiringPiSetup: Unable to open /dev/mem: Operation not permitted
This is a kernel issue solved in later updates of this kernel version.
In order to solve the problem you have two possibilities:
- Make a firmware update and versons later than 4.9.73+ solve this issue
- Keep you kernel and firmware but add iomem=relaxed to /boot/cmdline.txt