View: 7917|Reply: 3

Pi PC Debian and kernel module

[Copy link]

1

threads

15

posts

103

credits

Registered member

Rank: 2

credits
103
Published in 2016-2-13 17:07:25 | Show all floors |Read mode
Good day friends!
Just sorry for my bad english

I have Orange Pi PC v1.2
Worked use Debian image from Loboris. It worked perfectly!!!

Yesterday I found a Linux Kernel Module for HD44780 with I2C Expander(originally for Raspberry pi )
https://github.com/lucidm/lcdi2c

I wanted to use it on PI. Using OrangePi kernel sourcesI created a new kernel and compiled module lcdi2c.ko
After writing uImage on SD-card system has booted successfully.
I connected the display and decided to check the operation of the module.

  1. root@OrangePI:~# modinfo ./lcdi2c.ko
  2. filename:       /root/./lcdi2c.ko
  3. version:        0.1.0
  4. description:    Driver for HD44780 LCD with PCF8574 I2C extension.
  5. author:         Jarek Zok <jarekzok@gmail.com>
  6. license:        GPL
  7. srcversion:     7978FC46B63CF5649BF59AC
  8. alias:          i2c:lcdi2c
  9. depends:
  10. vermagic:       3.4.39-01-lobo SMP preempt mod_unload modversions ARMv7 p2v8
  11. parm:           busno: I2C Bus number, default 1 (uint)
  12. parm:           address: LCD I2C Address, default 0x27 (uint)
  13. parm:           pinout: I2C module pinout configuration, eight numbers
  14.                 representing following LCD modulepins in order: RS,RW,E,D4,D5,D6,D7,
  15.                 default 0,1,2,3,4,5,6,7 (array of uint)
  16. parm:           cursor: Show cursor at start 1 - Yes, 0 - No, default 1 (uint)
  17. parm:           blink: Blink cursor 1 - Yes, 0 - No, defualt 1 (uint)
  18. parm:           major: Device major number, default 0 (int)
  19. parm:           topo: Display organization, following values are currently supported:
  20.                 0 - 40x2
  21.                 1 - 20x4
  22.                 2 - 20x2
  23.                 3 - 16x4
  24.                 4 - 16x2
  25.                 5 - 16x1 Type 1
  26.                 6 - 16x1 Type 2
  27.                 7 - 8x2
  28.                 Default set to 16x2 (uint)
  29. root@OrangePI:~# insmod ./lcdi2c.ko busno=0
  30. root@OrangePI:~# lsmod
  31. Module                  Size  Used by
  32. lcdi2c                 14422  0
  33. 8189es                901572  0
  34. root@OrangePI:~# dmesg
  35.    ...
  36. [ 6637.970848] lcdi2c 0-0027: 16x2 LCD using bus 0x0, at address 0x27
  37. [ 6637.971232] lcdi2c 0-0027: registered with major 246
  38. root@OrangePI:~#
Copy code
The module is successfully loaded and running
Display shows - HD 44780 Driver
In the folder /sys/class created alphalcd.
I tested using lcddev.py

But there is one problem

As soon as I load module gpio-sunxi.ko display fails to work.
  1. root@OrangePI:~# modprobe gpio-sunxi
  2. root@OrangePI:~# dmesg
  3. ....
  4. [ 7494.718923] gpio_pin_1(362) gpio_request
  5. [ 7494.719252] gpio_pin_2(15) gpio_request
  6. [ 7494.719492] gpio_pin_3(12) gpio_request
  7. [ 7494.719729] gpio_pin_4(11) gpio_request
  8. [ 7494.719981] gpio_pin_5(6) gpio_request
  9. [ 7494.720321] gpio_pin_6(13) gpio_request
  10. [ 7494.720641] gpio_pin_7(14) gpio_request
  11. [ 7494.720964] gpio_pin_8(1) gpio_request
  12. [ 7494.721271] gpio_pin_9(110) gpio_request
  13. [ 7494.721591] gpio_pin_10(0) gpio_request
  14. [ 7494.721904] gpio_pin_11(3) gpio_request
  15. [ 7494.722229] gpio_pin_12(68) gpio_request
  16. [ 7494.722576] gpio_pin_13(71) gpio_request
  17. [ 7494.722919] gpio_pin_14(64) gpio_request
  18. [ 7494.723256] gpio_pin_15(65) gpio_request
  19. [ 7494.723592] gpio_pin_16(2) gpio_request
  20. [ 7494.723898] gpio_pin_17(66) gpio_request
  21. [ 7494.724219] gpio_pin_18(67) gpio_request
  22. [ 7494.724567] gpio_pin_19(21) gpio_request
  23. [ 7494.724938] gpio_pin_20(19) gpio_request
  24. [ 7494.725280] gpio_pin_21(18) gpio_request
  25. [ 7494.725621] gpio_pin_22(7) gpio_request
  26. [ 7494.725981] gpio_pin_23(8) gpio_request
  27. [ 7494.726337] gpio_pin_24(200) gpio_request
  28. [ 7494.726706] gpio_pin_25(9) gpio_request
  29. [ 7494.727008] gpio_pin_26(10) gpio_request
  30. [ 7494.727274] gpio_pin_27(201) gpio_request
  31. [ 7494.727650] gpio_pin_28(20) gpio_request
  32. [ 7494.727985] gpio_pin_29(198) gpio_request
  33. [ 7494.728276] gpio_pin_30(199) gpio_request
  34. [ 7494.728697] gpio name is PL10, ret = 0
  35. [ 7494.729196] gpio name is PA15, ret = 0
  36. [ 7494.729618] gpio name is PA12, ret = 0
  37. [ 7494.730170] gpio name is PA11, ret = 0
  38. [ 7494.730710] gpio name is PA6, ret = 0
  39. [ 7494.731143] gpio name is PA13, ret = 0
  40. [ 7494.731582] gpio name is PA14, ret = 0
  41. [ 7494.731988] gpio name is PA1, ret = 0
  42. [ 7494.732469] gpio name is PD14, ret = 0
  43. [ 7494.732907] gpio name is PA0, ret = 0
  44. [ 7494.733284] gpio name is PA3, ret = 0
  45. [ 7494.733664] gpio name is PC4, ret = 0
  46. [ 7494.734055] gpio name is PC7, ret = 0
  47. [ 7494.734447] gpio name is PC0, ret = 0
  48. [ 7494.734845] gpio name is PC1, ret = 0
  49. [ 7494.735245] gpio name is PA2, ret = 0
  50. [ 7494.735588] gpio name is PC2, ret = 0
  51. [ 7494.736014] gpio name is PC3, ret = 0
  52. [ 7494.736402] gpio name is PA21, ret = 0
  53. [ 7494.736788] gpio name is PA19, ret = 0
  54. [ 7494.737108] gpio name is PA18, ret = 0
  55. [ 7494.737443] gpio name is PA7, ret = 0
  56. [ 7494.737793] gpio name is PA8, ret = 0
  57. [ 7494.738115] gpio name is PG8, ret = 0
  58. [ 7494.738451] gpio name is PA9, ret = 0
  59. [ 7494.738826] gpio name is PA10, ret = 0
  60. [ 7494.739249] gpio name is PG9, ret = 0
  61. [ 7494.739625] gpio name is PA20, ret = 0
  62. [ 7494.740081] gpio name is PG6, ret = 0
  63. [ 7494.740435] gpio name is PG7, ret = 0
  64. [ 7494.740930] gpio_init finish with uesd 1!
  65. [ 7570.290123] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  66. [ 7575.340129] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  67. [ 7580.440119] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  68. [ 7585.440119] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  69. [ 7590.440131] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  70. [ 7595.440103] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  71. [ 7600.440100] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  72. [ 7605.440116] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  73. [ 7610.440123] sunxi_i2c_do_xfer()973 - [i2c0] xfer timeout (dev addr:0x27)
  74. root@OrangePI:~#
Copy code

I do not know how to diagnose it

Any ideas?
Any help

1

threads

15

posts

103

credits

Registered member

Rank: 2

credits
103
 Author| Published in 2016-2-17 13:33:06 | Show all floors
Friends online http: // orange pi.pp.ua
I suggested the problem with my loading modules

Almost all the conclusions have a double or even a dual purpose, Simultaneity can not use them, extracts from script.fex:
  1.     ;---------------------------------------------------------------------------------
  2.     ;i2c configuration
  3.     ;----------------------------------------------------------------------------------
  4.     [twi0]
  5.     twi_used        = 1
  6.     twi_scl         = port:PA11<2><default><default><default>
  7.     twi_sda         = port:PA12<2><default><default><default>

  8.     [twi1]
  9.     twi_used        = 1
  10.     twi_scl         = port:PA18<3><default><default><default>
  11.     twi_sda         = port:PA19<3><default><default><default>

  12.     [twi2]
  13.     twi_used        = 0
  14.     twi_scl         = port:PE12<3><default><default><default>
  15.     twi_sda         = port:PE13<3><default><default><default>



  16.     ;----------------------------------------------------------------------------------
  17.     ;userspace gpio interface
  18.     ; ** COMMENT THE PINS USED IN OTHER INTERFACES (I2C, SPI, 1-WIRE...)
  19.     ;----------------------------------------------------------------------------------
  20.     [gpio_para]
  21.     gpio_used       = 1

  22.     ;gpio_num        = 30
  23.     gpio_pin_1      = port:PL10<1><default><default><1>
  24.     gpio_pin_2      = port:PA15<1><default><default><0>
  25.     ;gpio_pin_3      = port:PA12<1><default><default><0>
  26.     ;gpio_pin_4      = port:PA11<1><default><default><0>
  27.     gpio_pin_5      = port:PA06<1><default><default><0>
  28.     gpio_pin_6      = port:PA13<1><default><default><0>
  29.     gpio_pin_7      = port:PA14<1><default><default><0>
  30.     gpio_pin_8      = port:PA01<1><default><default><0>
  31.     gpio_pin_9      = port:PD14<1><default><default><0>
  32.     gpio_pin_10      = port:PA00<1><default><default><0>
  33.     gpio_pin_11      = port:PA03<1><default><default><0>
  34.     gpio_pin_12      = port:PC04<1><default><default><0>
  35.     gpio_pin_13      = port:PC07<1><default><default><0>
  36.     gpio_pin_14      = port:PC00<1><default><default><0>
  37.     gpio_pin_15      = port:PC01<1><default><default><0>
  38.     gpio_pin_16      = port:PA02<1><default><default><0>
  39.     gpio_pin_17      = port:PC02<1><default><default><0>
  40.     gpio_pin_18      = port:PC03<1><default><default><0>
  41.     gpio_pin_19      = port:PA21<1><default><default><0>
  42.     ;gpio_pin_20      = port:PA19<1><default><default><0>
  43.     ;gpio_pin_21      = port:PA18<1><default><default><0>
  44.     gpio_pin_22      = port:PA07<1><default><default><0>
  45.     gpio_pin_23      = port:PA08<1><default><default><0>
  46.     gpio_pin_24      = port:PG08<1><default><default><0>
  47.     gpio_pin_25      = port:PA09<1><default><default><0>
  48.     gpio_pin_26      = port:PA10<1><default><default><0>
  49.     gpio_pin_27      = port:PG09<1><default><default><0>
  50.     gpio_pin_28      = port:PA20<1><default><default><0>
  51.     gpio_pin_29      = port:PG06<1><default><default><0>
  52.     gpio_pin_30      = port:PG07<1><default><default><0>
Copy code


If both modules are used (xxx_used = 1), comment from gpio needed to i2c port to gpio they did not pick up.

it works great!!!!
Thanks! @AlDemin

0

threads

5

posts

26

credits

Novice

Rank: 1

credits
26
Published in 2016-2-17 02:47:54 | Show all floors
@StaLeWaR29 - Would I be able to recompile the Loboris's kernel to add support for specific netfilter extensions or build them as modules using the same procedure you used? If so, can you elaborate a little on how you recompiled the kernel? The directions at https://github.com/loboris/OrangePI-Kernel are very brief.

Thanks

1

threads

15

posts

103

credits

Registered member

Rank: 2

credits
103
 Author| Published in 2016-2-17 13:27:34 | Show all floors
Why not? =)
What exactly is your problem with compiling a kernel?
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list