BPI-WiringPi now supports BPI-M2.Please go with the latest M2-BSP kernel source code. (you may go to [BPI M2] BPI-M2-BSP Updates,WiringPi supported for more info)
You may download from github. https://github.com/BPI-SINOVOIP/BPI-WiringPi/tree/BPI_M2
BPI-WiringPi README This is a modified WiringPi for BPI M1 / M1Plus /M2. We call it BPI-WiringPi. It is based on the original WiringPi for Raspberry Pi created by Drogon. The modification is done by BPI-Team. The BPI-WiringPi API usage are the same to the original wiringPi. You can donwload the original wiringPi from: git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi.
Download For BPI-M2
git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi.git -b BPI_M2
cd BPI-WiringPi chmod +x ./build sudo ./build
You can go to folder "“m2_test” to test sample codes.