bodtx Posted March 31, 2018 Posted March 31, 2018 Hi, I'm trying to build wiring on my OPIZ here is the PI: Welcome to ARMBIAN 5.38 stable Debian GNU/Linux 9 (stretch) 4.14.18-sunxi System load: 0.41 0.25 0.10 Up time: 1 min Memory usage: 9 % of 493MB IP: 192.168.1.18 CPU temp: 35°C Usage of /: 8% of 15G here is the log GPIO Utility [Link] /usr/bin/ld: gpio.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC gpio.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status Makefile:48: recipe for target 'gpio' failed make: *** [gpio] Error 1 I tried to add -fPIC flag in gpio/Makefile with no succes @$(CC) -o $@ $(OBJ) $(LDFLAGS) -fPIC $(LIBS)
Larry Bank Posted April 1, 2018 Posted April 1, 2018 Do you specifically need WiringOP or do you just want a simple way to access GPIO? If the later, you can try my ArmbianIO library: https://github.com/bitbank2/ArmbianIO I created a new API interface that's much simpler to deal with. GPIO pins are referenced by physical pin number and this allows using all available GPIOs.
bodtx Posted April 1, 2018 Author Posted April 1, 2018 waooo, your lib is a great idea. I do not need a special compatibility with wiringPi, but I would like to drive a MCU with serial communication (more basic than spi or i2c), in your function available I don not see somtehing like this
Larry Bank Posted April 1, 2018 Posted April 1, 2018 2 hours ago, bodtx said: waooo, your lib is a great idea. I do not need a special compatibility with wiringPi, but I would like to drive a MCU with serial communication (more basic than spi or i2c), in your function available I don not see somtehing like this The I2C and SPI support isn't needed since there are standard Linux interfaces. GPIO pins are the only oddity where the header pin can be connected to anything depending on the board manufacturer. Linux also supports serial ports with a standard interface, so it's not necessary to add it to my ArmbianIO project.
bodtx Posted April 1, 2018 Author Posted April 1, 2018 with something like this ? Is there any known lib in C for that, it seems very manual. thx for pointing to me that it was a linux classic. Btw it is for controlling a 433 RF emitter
Larry Bank Posted April 1, 2018 Posted April 1, 2018 58 minutes ago, bodtx said: with something like this ? Is there any known lib in C for that, it seems very manual. thx for pointing to me that it was a linux classic. Btw it is for controlling a 433 RF emitter You found a reasonable example of how to initialize and control a serial port in Linux. I wrote similar code for one of my projects. I'm sure there are some libraries to simplify access, but I'm not familiar with them.
Recommended Posts