WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: A10 boot files  (Read 41651 times)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: A10 boot files
« Reply #30 on: August 09, 2013, 08:37:33 AM »
insmod: can't insert 'sun4i-gpio.ko': invalid module format

I know that this error is because of my kernel version is not the one on which I am running the insmod command, but I don't know what to do to sort out this problem?

You have already pinned down the issue by yourself...

kernel modules are specific to a kernel build, so make sure you insmod modules respective to kernel you are running.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #31 on: August 09, 2013, 09:07:39 AM »
Dear tinypoodle,

What is your opinion about the following lines ?

Thank you.

:
:
insmod: can't insert 'sun4i-gpio.ko': invalid module format
:
:
I run dmesg and uname -a commands and the results are :

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ dmesg
:
:
[ 2239.490000] sun4i_gpio: module_layout: kernel tainted.
[ 2239.500000] Disabling lock debugging due to kernel taint
[ 2239.500000] sun4i_gpio: version magic '3.0.42 ARMv7 ' should be '3.0.42 preempt mod_unload modversions ARMv7 '
[ 3118.120000] spi_sunxi: version magic '3.0.42 ARMv7 ' should be '3.0.42 preempt mod_unload modversions ARMv7 '

tc@box:/mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/misc$ uname -a
Linux box 3.0.42 #3 PREEMPT Fri Feb 8 18:38:58 PST 2013 armv7l GNU/Linux
« Last Edit: August 09, 2013, 09:11:56 AM by persian »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11666
Re: A10 boot files
« Reply #32 on: August 09, 2013, 10:50:17 AM »
Hi persian
It's rejecting the module because its version does not match the version of your kernel.
sun4i_gpio version=3.0.42 ARMv7
kernel version=3.0.42 #3 PREEMPT

I removed the attachment from your previous post. Forum rules forbid the attachment of binaries.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #33 on: August 09, 2013, 01:50:26 PM »
Appears that gpio could be made into a loadable module with existing kernel. I did such.
However, enabling spi requires a new kernel. Therefore your issue.
I assume that you built a new kernel, so next step is to make it Allwinner loadable with mkimage.

You can import u-boot-tools, loadsce u-boot-tools to get mkimage.
Then from your linux source directory

make uImage

Finally copy uImage to sdcard to test boot. Then try insmod your new modules.
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #34 on: August 10, 2013, 03:32:24 AM »
Dear Roberts,

Thank you, for your effective replies to my questions.

I replaced the [.config] file with [a10Core-kernel-3.0.42.config] and make the uImage successfully and then boot the TC linux from uSD with it.

Also I make a new script.bin for GPIO support (but not for SPI because I don't know how to do it).

Now GPIO attached and work correctly, but when I reboot Marsboard the GPIO disappear!

How can I establish the GPIO for ever ?
I tested the modprobe but It did not have any permanent effect after insmod (and before insmod it make  "not found in modules.dep" error).

Also when I run insmod command for spi_sunxi.ko, I get the following error:

root@box:~# insmod /mnt/mmcblk0p2/My_Added_Modules/lib/modules/3.0.42/kernel/drivers/spi/spi_sunxi.ko
Segmentation fault


The dmesg command report the following error:
:
:
[ 1768.180000] [spi]: sw spi init !!
[ 1768.180000] [spi]: Found 0 spi devices in config files
[ 1768.190000] [spi]: boards num modalias         max_spd_hz       bus_num  cs   mode
[ 1768.200000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 1768.210000] pgd = e7298000
[ 1768.210000] [00000000] *pgd=672e8831, *pte=00000000, *ppte=00000000
[ 1768.220000] Internal error: Oops: 80000007 [#1] PREEMPT
[ 1768.220000] Modules linked in: spi_sunxi(+)
[ 1768.220000] CPU: 0    Not tainted  (3.0.42 #6)
[ 1768.220000] PC is at 0x0
[ 1768.220000] LR is at spi_sunxi_register_spidev+0x1e4/0x2a4 [spi_sunxi]
[ 1768.220000] pc : [<00000000>]    lr : [<bf009c34>]    psr: 60000013
[ 1768.220000] sp : e72e3e08  ip : e72e3c88  fp : e72e3e5c
[ 1768.220000] r10: c0097754  r9 : 000008ab  r8 : 00000000
[ 1768.220000] r7 : bf00b124  r6 : 00000000  r5 : 00000000  r4 : 00000004
[ 1768.220000] r3 : 00000002  r2 : e72e2000  r1 : 00000000  r0 : 00000000
[ 1768.220000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1768.220000] Control: 10c5387d  Table: 67298019  DAC: 00000015
:
:
[ 1768.220000] Backtrace:
[ 1768.220000] [<bf009a50>] (spi_sunxi_register_spidev+0x0/0x2a4 [spi_sunxi]) from [<bf00d728>] (spi_sunxi_init+0xb0/0x174 [spi_sunxi])
[ 1768.220000]  r7:e48fd500 r6:00000000 r5:e72e3e64 r4:00000004
[ 1768.220000] [<bf00d678>] (spi_sunxi_init+0x0/0x174 [spi_sunxi]) from [<c003539c>] (do_one_initcall+0x40/0x184)
[ 1768.220000]  r6:00000000 r5:e72e2000 r4:c07e7c00
[ 1768.220000] [<c003535c>] (do_one_initcall+0x0/0x184) from [<c0098bec>] (sys_init_module+0x3c8/0x1ad0)
[ 1768.220000] [<c0098824>] (sys_init_module+0x0/0x1ad0) from [<c003ba80>] (ret_fast_syscall+0x0/0x30)
[ 1768.220000] Code: bad PC value
[ 1768.730000] ---[ end trace fa9e0a8b1d7a4898 ]---


Please help me about the above error.

Thank you again.
« Last Edit: August 10, 2013, 12:08:09 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #35 on: August 10, 2013, 01:55:07 PM »
I am not knowledgable on GPIO and SPI as these have more to do with the maker crowd and are not needed for desktop. 

You don't have any spi devices.
See: ls -l /dev/spi*

As far as your question about rebooting:
One step at a time. First be sure the module works then you can make a simple sce for them that will load upon boot.
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #36 on: August 10, 2013, 03:57:06 PM »
Dear Roberts,

I configured the script.bin for GPIO and SPI .

GPIO module works fine but I must run insmod every time I reboot the Marsboard.

I don't know how to make a loadable sce for boot time.

Also the insmod of SPI module makes Segmentation fault error.

My SPI settings in script.bin are as follow:

[spi0_para]
spi_used = 1
spi_cs_bitmap = 1
spi_cs0 = port:PI10<3><default><default><default>
spi_sclk = port:PI11<3><default><default><default>
spi_mosi = port:PI12<3><default><default><default>
spi_miso = port:PI13<3><default><default><default>

[spi1_para]
spi_used = 0
spi_cs_bitmap = 1
spi_cs0 = port:PA00<4><default><default><default>
spi_sclk = port:PA01<4><default><default><default>
spi_mosi = port:PA02<4><default><default><default>
spi_miso = port:PA03<4><default><default><default>

[spi2_para]
spi_used = 0
spi_cs_bitmap = 1
spi_cs0 = port:PB14<2><default><default><default>
spi_sclk = port:PB15<2><default><default><default>
spi_mosi = port:PB16<2><default><default><default>
spi_miso = port:PB17<2><default><default><default>
spi_cs0 = port:PC19<3><default><default><default>
spi_sclk = port:PC20<3><default><default><default>
spi_mosi = port:PC21<3><default><default><default>
spi_miso = port:PC22<3><default><default><default>

[spi3_para]
spi_used = 0
spi_cs_bitmap = 1
spi_cs0 = port:PA05<3><default><default><default>
spi_sclk = port:PI06<3><default><default><default>
spi_mosi = port:PI07<3><default><default><default>
spi_miso = port:PI08<3><default><default><default>
spi_cs1 = port:PA09<3><default><default><default>

[spi_devices]
spi_dev_num = 1

[spi_board0]
modalias = "My SPI port-0"
max_speed_hz = 12000000
bus_num = 1
chip_select = 0
mode = 3
full_duplex = 0
manual_cs = 0

Thank you for your helps.
« Last Edit: August 10, 2013, 03:59:18 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #37 on: August 12, 2013, 12:09:58 AM »
There are many changes in this area with newer kernel. Should be worth investigating, e.g.
CONFIG_SPI_SPIDEV


« Last Edit: August 12, 2013, 12:14:13 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #38 on: August 14, 2013, 01:25:33 PM »
Dear friends;

Hi,

Today my import did not work and it exit by no error!

When I traced the /usr/bin/import script file, I found that the first wget command with the following parameters return an error:

The line:
      wget -O /tmp/.depfile -cq "$IMPORTMIRROR"/PKGADDDEPS 2"
with the final content:
      wget -O /tmp/.depfile -cq http://repo.tinycorelinux.net/5.x/import/PKGADDDEPS 2

Returned message:
      wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable

What's wrong ?

Also I need a command like lsusb but I don't find it.

Please help me about these problems.

Thank you.
« Last Edit: August 14, 2013, 01:28:51 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #39 on: August 14, 2013, 01:52:08 PM »
Make sure your /tmp directory is writable by user tc.
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #40 on: August 14, 2013, 02:05:26 PM »
Dear Roberts,

The TC user permission is OK.

I tested it by creating a text file with the following command:
   tc@box:/tmp$ nano test.txt


The problem solved, I think it's an Internet problem.

What about lsusb command ?

Thanks
« Last Edit: August 14, 2013, 02:18:17 PM by persian »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #41 on: August 14, 2013, 05:08:04 PM »
Google search of "wheezy lsusb" reveals: http://packages.debian.org/wheezy/usbutils
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
Re: A10 boot files
« Reply #42 on: August 15, 2013, 04:42:32 AM »
Dear Roberts

Thank you for your reply to my questions.

I attached a A4-Tech model: PK-760E webcam to my Marsboard and the board recognized it as follow with lsbusb command:

Bus 004 Device 003: ID 0ac8:3450 Z-Star Microelectronics Corp.

The command ls /dev | grep video returned blank and I can not run uvccapture, mplayer or webcam application for using webcam.

I googled but I did not find a detail instructions for installing webcam device driver for A4-Tech webcam.

Would you please help me about this problem for Tinycore linux ?

Thank you again.


Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A10 boot files
« Reply #43 on: August 15, 2013, 01:39:29 PM »
Likely you need a module. If you are using 3.0.42, as currently provided, then the modules can be found here:
http://tinycorelinux.net/5.x/armv7
10+ Years Contributing to Linux Open Source Projects.

Offline persian

  • Newbie
  • *
  • Posts: 28
The flwm_topside and wbar do not run on new TCL (a10Core-130904.img.gz).
« Reply #44 on: September 16, 2013, 02:19:25 PM »
Dear Roberts,

Hi,

The flwm_topside and wbar do not run with new TCL (a10Core-130904.img.gz) on my Marsboard.

I get many errors for udev on startup and X desktop server error on HDMI screen and also the following error on putty terminal.

tc@box:~$ flwm_topside
Can't open display:


tc@box:~$ X

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-4-mx5 armv7l Debian
Current Operating System: Linux box 3.0.42 #3 PREEMPT Fri Feb 8 18:38:58 PST 2013 armv7l
Kernel command line: console=tty0 init=/init rootwait panic=10 loglevel=3 disp.screen0_output_mode=EDID:1280x720p60 hdmi.audio=EDID:0 nozswap nortc
Build Date: 17 April 2013  11:31:56AM
xorg-server 2:1.12.4-6 (Julien Cristau <jcristau@debian.org>)
Current version of pixman: 0.26.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Sep 16 18:31:23 2013
(==) Using system config directory "/usr/share/X11/xorg.conf.d"


Also lxde and xfce do not run on new TCL version (such as version 20130712)

Please check it and help me about this problem.

Thank you for your help and the new options (such as import/debs and mksdcard) for current version.
« Last Edit: September 16, 2013, 02:39:28 PM by persian »