Ahmet Cihat Holta Posted January 18, 2018 Posted January 18, 2018 Hi all, I have a OrangePi Zero 2 Plus - H5 and installed Armbian buut when i build WiringOP it gives hardware line is missin message. I think so /proc/cpuinfo file is creating by armbian when bord is booting and lines contains all cpu informations. How can i fix the issue? There is any idea? Thanks in advance.
zador.blood.stained Posted January 18, 2018 Posted January 18, 2018 This has to be fixed by WiringOP libraries developers - the mainline kernel doesn't provide this parameter in /proc/cpuinfo, userspace libraries should use other ways to detect SoC and board model at runtime.
Ahmet Cihat Holta Posted January 18, 2018 Author Posted January 18, 2018 Thanks a lot for your reply. Regards
tkaiser Posted January 18, 2018 Posted January 18, 2018 42 minutes ago, zador.blood.stained said: userspace libraries should use other ways to detect SoC and board model at runtime. As already suggested to @Larry Bank for his ArmbianIO project a while ago: eg. checking for existence of /proc/device-tree/model and reading the string from there. The DT node exists for a reason.
zador.blood.stained Posted January 18, 2018 Posted January 18, 2018 1 hour ago, tkaiser said: As already suggested to @Larry Bank for his ArmbianIO project a while ago: eg. checking for existence of /proc/device-tree/model and reading the string from there. The DT node exists for a reason. Or, as I suggested before, read /proc/device-tree/compatible (null-separated array) which contains both the board name and SoC name, so even if the library doesn't support a new board it can at least support SoC specific pin map. 1
Larry Bank Posted January 18, 2018 Posted January 18, 2018 1 hour ago, zador.blood.stained said: Or, as I suggested before, read /proc/device-tree/compatible (null-separated array) which contains both the board name and SoC name, so even if the library doesn't support a new board it can at least support SoC specific pin map. There is no "SoC specific pin map". The SoC info is not enough to know the pin map because it's completely arbitrary and up to the board manufacturer. The 40-pin header on the NanoPi boards use different GPIO ports from the 40-pin header on OrangePi boards.
zador.blood.stained Posted January 18, 2018 Posted January 18, 2018 4 minutes ago, Larry Bank said: There is no "SoC specific pin map". There is no pin header map but you can still access pins by their port bank and number in the bank, i.e. PA10, PC3, PD6 on Allwinner devices.
Larry Bank Posted January 18, 2018 Posted January 18, 2018 2 minutes ago, zador.blood.stained said: There is no pin header map but you can still access pins by their port bank and number in the bank, i.e. PA10, PC3, PD6 on Allwinner devices. That misses the point of ArmbianIO. The purpose of it is that when you connect your device to pin X (e.g. 1-40) on the GPIO header, you reference X in your code and don't have to deal with the specifics of each SoC/board. The only way to accomplish that is to have a specific pin map for each board and properly identify the board. I recently added a new option that lets you manually specify the board by name if it doesn't see the machine.id.
zador.blood.stained Posted January 18, 2018 Posted January 18, 2018 1 minute ago, Larry Bank said: That misses the point of ArmbianIO. AFAIK we are talking about WiringOP forks in general, not only ArmbianIO. And as I remember RPI.GPIO allows using 2 different pin numbering schemes - SoC ("BCM") numbering and pin header ("RPI") numbering.
edupv Posted February 24, 2018 Posted February 24, 2018 A dirty hack to make it working in orangepi PC2 immediately : Edit the file WiringOP/wiringPi/wiringPi.c (https://github.com/tumugin/WiringOP), change the function isH5(void) to : int isH5(void) { return 1; } then "sudo ./build". I don't know C language, so there is no better way for me. Edit : I have verified the following is working, other pins/functions are not tested : ## Tested with LED + resistor across physical pin 1 (3.3V) and pin 7 PORT=7 gpio mode $PORT out gpio write $PORT 0; ## LED on gpio write $PORT 1; ## LED off 1
Recommended Posts