Ilesar Posted April 1, 2020 Share Posted April 1, 2020 Hi, I'm new in the world of embedded linux and i want to create a program to write words on the Oled display on zedboard. I use Petalinux 2018.2 and apparently the oled driver is not there by default. So i added the drivers created by digilent https://github.com/Digilent/linux-digilent/blob/86b46b6606eea44c59af56b732e5393f2eb0adce/drivers/staging/pmods/pmodoled-gpio.c in a petalinux module. But now i want to use the functions defined by the driver in a application in order to use later a TCP server to get the words to display in the oled by another device. But i can't made the link between the driver and the application. Am i using the wrong method ? Somebody can help me ? Link to comment Share on other sites More sharing options...
Ionel Posted April 3, 2020 Share Posted April 3, 2020 Have you issued petalinxu-config --get-hw-description=/path/to/hdf/directory ? Link to comment Share on other sites More sharing options...
Ionel Posted April 10, 2020 Share Posted April 10, 2020 For that driver you need AXIGPIO not the pmodoled IP. If you do not use the driver(which is obsolete) the pmodoled IP will be accessible in user-space via uio (libuio). And for this you can find examples in many other projects. Link to comment Share on other sites More sharing options...
Ilesar Posted April 10, 2020 Author Share Posted April 10, 2020 14 hours ago, Ionel said: I don't find the answer in this topic, i think it miss few messages. Link to comment Share on other sites More sharing options...
Ionel Posted April 9, 2020 Share Posted April 9, 2020 Link to comment Share on other sites More sharing options...
Ilesar Posted April 9, 2020 Author Share Posted April 9, 2020 Thanks for your time ! I replaced &gpiops by &gpio0, apparently it is the only one that made the device tree compile, ( otherwise i got system-top.dtb: ERROR (phandle_references): Reference to non-existent node or label "gpiops") but i still have the sames errors that in my previous message when i launch petalinux. I see in the documentation that there are two examples with differents pin numbers. Where i can find the right one for my design ? Thank you ! Link to comment Share on other sites More sharing options...
Ionel Posted April 9, 2020 Share Posted April 9, 2020 Also notice that PmodOLED IP has no IRQ so none should be specified in device tree. You can find the parameters for pmodoled node here Pmods were removed in commit: 3953cedd78464cab Link to comment Share on other sites More sharing options...
Ionel Posted April 9, 2020 Share Posted April 9, 2020 /include/ "system-conf.dtsi" / { }; &PmodOLED_0 { compatible = "dglnt,pmodoled-gpio"; /*other prameters you need to adjust excpt reg*/ }; your system-user.dtsi should look like this. Link to comment Share on other sites More sharing options...
Ilesar Posted April 9, 2020 Author Share Posted April 9, 2020 yes it does, there is the pl code : / { amba_pl: amba_pl { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; ranges ; PmodOLED_0: PmodOLED@40000000 { compatible = "xlnx,PmodOLED-1.0"; reg = <0x40000000 0x10000 0x40010000 0x1000>; }; }; }; Link to comment Share on other sites More sharing options...
Ionel Posted April 9, 2020 Share Posted April 9, 2020 Was the pmodoled-gpio@e0010000 added in pl.dtsi ? Link to comment Share on other sites More sharing options...
Ilesar Posted April 5, 2020 Author Share Posted April 5, 2020 Okay, i found the syntax error, it was the "pmodoled-gpio_instance: " witch shoudn't be there. But now, how do i find the correct values to set in the node ? Is it with Vivado ? Furthermore, i got this when i launch petalinux : pmodoled_gpio: loading out-of-tree module taints kernel. platform spi_gpio.2: spi_busnum_to_master(2) returned NULL pmodoled-gpio zed_oled: add_gpio_pmodoled_device_to_bus failed: -38 pmodoled-gpio: probe of zed_oled failed with error -38 Could you help me ? Thanks. Link to comment Share on other sites More sharing options...
Ilesar Posted April 3, 2020 Author Share Posted April 3, 2020 Yes i did, this is the command i used : $ petalinux-config --get-hw-description=~/external_mux/external_mux.sdk Link to comment Share on other sites More sharing options...
Ilesar Posted April 3, 2020 Author Share Posted April 3, 2020 Thank you, I implemented the the pmod oled ip in the following project : but when i write the node in system-user.dtsi, following the module readme, i got an error in compilation ( the value are set random for now as i don't know how to find the good ones) : /include/ "system-conf.dtsi" / { pmodoled-gpio_instance: pmodoled-gpio@e0010000 { compatible = "xlnx,pmodoled-gpio"; reg = <e0010000 0x1000>; interrupt-parent = <&intc>; interrupts = < 0 26 4 >; }; }; Do you known where that come from ? Thank you in advance. Link to comment Share on other sites More sharing options...
Ionel Posted April 3, 2020 Share Posted April 3, 2020 Yes in system-user.dtsi you will add your node or changes to the node. For application you will need to read write from file (character device file provided by the driver in /dev/) Link to comment Share on other sites More sharing options...
Ilesar Posted April 3, 2020 Author Share Posted April 3, 2020 Thanks, i will try that. The device tree file i need to modify is system-user.dtsi, right ? For the application c code, will i need to add something (like an include) or will the functions of the driver be defined by default ? Link to comment Share on other sites More sharing options...
Ionel Posted April 3, 2020 Share Posted April 3, 2020 After you add the pmod oled IP in vivado project. Then you set petalinux project to use the new hdf(includes bitstream). Then you need to add a node for it in the device tree to load this driver. Link to comment Share on other sites More sharing options...
Ilesar Posted April 2, 2020 Author Share Posted April 2, 2020 Thank you for your anwer, I got : root@oled:~# lsmod | grep gpio pmodoled_gpio 16384 0 - Live 0xbf000000 (O) but only after i launch insmod with the path you gave me, otherwise lsmod display nothing. Link to comment Share on other sites More sharing options...
Ionel Posted April 2, 2020 Share Posted April 2, 2020 For insmod you need to provide the path to .ko. If the module is somewhere under /lib/modules/{kernel-vesion}/ it may already be loaded. Please post output of this command. lsmod | grep gpio Link to comment Share on other sites More sharing options...
Ilesar Posted April 1, 2020 Author Share Posted April 1, 2020 I got : insmod : can't insert 'pmodoled-gpio.ko': no such file or directory. Link to comment Share on other sites More sharing options...
Ionel Posted April 1, 2020 Share Posted April 1, 2020 what is the output of lsmod ? Link to comment Share on other sites More sharing options...
Ilesar Posted April 1, 2020 Author Share Posted April 1, 2020 Thank you for your answer, the module is build, i have the .ko file, but the driver don't seems to be loaded into the board. Link to comment Share on other sites More sharing options...
Ionel Posted April 1, 2020 Share Posted April 1, 2020 Have you managed to build the module(search for it in /lib/modules/ )? Did the driver load? (check boot log or dmesg for "PmodOLED display driver") Link to comment Share on other sites More sharing options...
Question
Ilesar
Hi,
I'm new in the world of embedded linux and i want to create a program to write words on the Oled display on zedboard. I use Petalinux 2018.2 and apparently the oled driver is not there by default. So i added the drivers created by digilent https://github.com/Digilent/linux-digilent/blob/86b46b6606eea44c59af56b732e5393f2eb0adce/drivers/staging/pmods/pmodoled-gpio.c in a petalinux module.
But now i want to use the functions defined by the driver in a application in order to use later a TCP server to get the words to display in the oled by another device. But i can't made the link between the driver and the application.
Am i using the wrong method ?
Somebody can help me ?
Link to comment
Share on other sites
21 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.