WILC1000 not working in SAM5D2_Xplained Board

Moderator: nferre

freaky_geek234
Posts: 9
Joined: Sat May 13, 2017 12:06 pm

WILC1000 not working in SAM5D2_Xplained Board

Fri Oct 20, 2017 12:11 pm

Hi,
Iam trying to port WILC1000 to linux (Atmel SAMA5D2_Xplained board). I have enabled WILC1000 SPI driver in staging drivers as a module (option <M>)

I have copied wilc1000_spi.ko and wilc1000.ko to /lib/modules/${Kernel_version}/kernel/drivers/staging/wilc/

and copied wilc1003_firmware.bin (which i got from some github) to /lib/firmware/atmel (atmel folder created by me) and also checked copying to lib/firmware, /atmel/ , /lib/modules/${Kernel_version}/kernel/drivers/staging/wilc/ also

I have made entry for wilc1000_spi in dts file as below:

spi1: spi@fc000000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi1_default>;
status = "okay";

wilc_spi@0 {
compatible = "atmel,wilc_spi";
spi-max-frequency = <6000000>;
reg = <0>;
status = "okay";
};




};


but after doing all these things, wilc1000 is not being detected.

if i run ifconfig: wlan0 is not appearing.

in the document when insmod is bein run. then it is initializing wilc1000 and firmware also being initialized and updated. debug messages are being displayed.

but when iam running insmod, no messages are being displayed. if i run modinfo -F firmware wilc1000 or modinfo -F firmware wilc1000_spi then also iam not getting any firmware required info.

am i missing anything. how firmware is being updated or initialized by insmod command.

is there any way to debug this problem????
blue_z
Location: USA
Posts: 1639
Joined: Thu Apr 19, 2007 10:15 pm

Re: WILC1000 not working in SAM5D2_Xplained Board

Tue Oct 24, 2017 2:17 am

freaky_geek234 wrote:I have made entry for wilc1000_spi in dts file as below:
What kernel version?
What "dts file"?
What you present doesn't look complete. You reference a pinctrl_spi1_default; where is that defined?

freaky_geek234 wrote:is there any way to debug this problem????
You could enable debug-message capability in selected subsystems. Start with pin-control, and then spi.

Regards
freaky_geek234
Posts: 9
Joined: Sat May 13, 2017 12:06 pm

Re: WILC1000 not working in SAM5D2_Xplained Board

Wed Oct 25, 2017 3:32 pm

forgot to post pinctrl_spi1_default: spi1_default which is defined in my dts (at91-sama5d2_xplained_common.dtsi) file as follows:





pinctrl_spi1_default: spi1_default {
pinmux = <PIN_PC1__SPI1_SPCK>,
<PIN_PC2__SPI1_MOSI>,
<PIN_PC3__SPI1_MISO>,
<PIN_PC4__SPI1_NPCS0>;
bias-disable;
};
roberto2018
Posts: 1
Joined: Wed Apr 18, 2018 3:13 pm

Re: WILC1000 not working in SAM5D2_Xplained Board

Wed Apr 18, 2018 4:24 pm

I have a similar problem.
I use a SAMA5D2 board called RoadRunner made by Acmesystems.
I'm trying to connect the SAMA5D27 core to ATWILC1000 through the SPI1 port.
The board runs a 4.9.40 kernel Linux.
I have configured a ATWILC1000-SD module to operate over SPI signals.
I have connect the SPI_SS, SPI_RXD, SPI_CLK, SPI_TXD and IRQ pins, and pull up the CHIP_EN, RESET_N ones.
The SPI1 lines of the SAMA5D27 are:
PC1: SPI_CLK; PC2: SPI_TXD; PC3: SPI_RXD; PC4: SPI_CS0; PC5: IRQ request.
I have done modifications to "menuconfig" kernel and .DTB files.
I have successful compiled the WILC module (wilc.ko and wilc-spi.ko).
I have conveniently copied the firmware file wilc1000_wifi_firmware.bin to the /lib/firmware.
After boot and login I manually start the driver typing:
insmod wilc.ko and insmod wilc-spi.ko
The system first respond:
"WILC_SPI spi32766.0: WILC SPI probe success"
then shows a list of problems, but it seems it right reads the MAC address (as the last ifconfig shows in the log).
At the end the ATWILC1000 dosn't work.
Now the .DTB is configurated to operate at 500KHz, but the frequency is irrilevant, the result is the same from 5Mhz
down to 500Khz.
If someone can help me, I attach the modifications made to "menuconfig", the DTS file and the log.
Thanks in advance.

"menuconfig" **************

Device Drivers --->
[*] SPI support --->
<*> Atmel SPI Controller
<*> User mode SPI device driver support


WILC1000 SPI WiFi
Device Drivers
-- Staging Drivers
-- -- Atmel WILC1000 SPI

"Boot" ****************

Debian GNU/Linux 8 roadrunner ttyS0

roadrunner login: root
Password:
Last login: Mon Jan 9 01:59:13 CET 2012 on ttyS0
Linux roadrunner 4.9.40 #7 Tue Mar 13 15:00:16 CET 2018 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@roadrunner:~# ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOrandom: crng init done
ARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:37

eth0 Link encap:Ethernet HWaddr 00:04:25:12:34:56
inet addr:192.168.1.208 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::204:25ff:fe12:3456/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:99 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15300 (14.9 KiB) TX bytes:1270 (1.2 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@roadrunner:~# cd /mnt/SDStorage
root@roadrunner:/mnt/SDStorage# insmod wilc.ko
wilc: module is from the staging directory, the quality is unknown, you have been warned.
root@roadrunner:/mnt/SDStorage# insmod wilc-spi.ko
wilc_spi: module is from the staging directory, the quality is unknown, you have been warned.
WILC_SPI spi32766.0: WILC SPI probe success
root@roadrunner:/mnt/SDStorage# ------------[ cut here ]------------
WARNING: CPU: 0 PID: 1539 at drivers/spi/spi-atmel.c:1347 atmel_spi_transfer_one_message+0x6c4/0xb0c
Modules linked in: wilc_spi(C) wilc(C)
CPU: 0 PID: 1539 Comm: wpa_supplicant Tainted: G C 4.9.40 #7
Hardware name: Atmel SAMA5
[<c010cd1c>] (unwind_backtrace) from [<c010a77c>] (show_stack+0x10/0x14)
[<c010a77c>] (show_stack) from [<c0115e70>] (__warn+0xe4/0xfc)
[<c0115e70>] (__warn) from [<c0115f38>] (warn_slowpath_null+0x20/0x28)
[<c0115f38>] (warn_slowpath_null) from [<c0407500>] (atmel_spi_transfer_one_message+0x6c4/0xb0c)
[<c0407500>] (atmel_spi_transfer_one_message) from [<c0404ddc>] (__spi_pump_messages+0x390/0x4d4)
[<c0404ddc>] (__spi_pump_messages) from [<c0405084>] (__spi_sync+0x158/0x16c)
[<c0405084>] (__spi_sync) from [<c04050bc>] (spi_sync+0x24/0x3c)
[<c04050bc>] (spi_sync) from [<bf0210b8>] (wilc_spi_tx_rx+0x98/0xc8 [wilc_spi])
[<bf0210b8>] (wilc_spi_tx_rx [wilc_spi]) from [<bf02130c>] (spi_cmd_complete+0x11c/0x6a8 [wilc_spi])
[<bf02130c>] (spi_cmd_complete [wilc_spi]) from [<bf0218c0>] (spi_internal_read+0x28/0x4c [wilc_spi])
[<bf0218c0>] (spi_internal_read [wilc_spi]) from [<bf021f8c>] (wilc_spi_init+0x68/0x1e4 [wilc_spi])
[<bf021f8c>] (wilc_spi_init [wilc_spi]) from [<bf00ec00>] (wilc_wlan_init+0x2c/0x2e4 [wilc])
[<bf00ec00>] (wilc_wlan_init [wilc]) from [<bf0052b8>] (wilc_wlan_initialize+0xe8/0x440 [wilc])
[<bf0052b8>] (wilc_wlan_initialize [wilc]) from [<bf005670>] (wilc_mac_open+0x60/0x1f0 [wilc])
[<bf005670>] (wilc_mac_open [wilc]) from [<c0595104>] (__dev_open+0xb8/0x11c)
[<c0595104>] (__dev_open) from [<c0595390>] (__dev_change_flags+0x94/0x148)
[<c0595390>] (__dev_change_flags) from [<c059545c>] (dev_change_flags+0x18/0x48)
[<c059545c>] (dev_change_flags) from [<c05f0874>] (devinet_ioctl+0x614/0x738)
[<c05f0874>] (devinet_ioctl) from [<c057a3bc>] (sock_ioctl+0xe0/0x2c0)
[<c057a3bc>] (sock_ioctl) from [<c01b41d8>] (do_vfs_ioctl+0x9c/0x884)
[<c01b41d8>] (do_vfs_ioctl) from [<c01b49f4>] (SyS_ioctl+0x34/0x58)
[<c01b49f4>] (SyS_ioctl) from [<c0107460>] (ret_fast_syscall+0x0/0x3c)
---[ end trace 6f40e11d8c7e31da ]---
WILC_SPI spi32766.0: spi transfer timeout
WILC_SPI spi32766.0: SPI transaction failed
WILC_SPI spi32766.0: Failed cmd write, bus error...
WILC_SPI spi32766.0: Failed internal read cmd...
WILC_SPI spi32766.0: Failed internal read protocol with CRC on, retrying with CRC off...
WILC_SPI spi32766.0: Failed cmd response, cmd (c4), resp (00)
WILC_SPI spi32766.0: Failed internal read cmd...
WILC_SPI spi32766.0: Failed internal read protocol...
wlan0: WLAN Iinitialization FAILED
wlan0: Failed to set driver handler
wlan0: Host cmd 24 failed
wlan0: [Host Interface] undefined
wlan0: IRQ request succeeded IRQ-NUM= 116 on GPIO: 69
wlan0: Detect chip WILC1000
wlan0: loading firmware wilc1000_wifi_firmware.bin
wlan0: WILC Firmware Ver = WILC_WIFI_FW_REL_15_00_RC4 Build: 8837
wlan0: Command - 35638 - has been received
wlan0: Command - 35590 - has been received
wlan0: Command - 35595 - has been received
wlan0: Command - 35591 - has been received
wlan0: Command - 35604 - has been received
wlan0: Command - 35610 - has been received
wlan0: Command - 35634 - has been received
wlan0: Command - 35636 - has been received
wlan0: Command - 35636 - has been received
wlan0: Command - 35626 - has been received
wlan0: Command - 35634 - has been received
WILC_SPI spi32766.0: Failed cmd response, cmd (c4), resp (00)
WILC_SPI spi32766.0: Failed internal read cmd...
WILC_SPI spi32766.0: Failed internal read protocol...
wlan0: WLAN Iinitialization FAILED
WILC_SPI spi32766.0: Failed cmd response, cmd (c4), resp (00)
root@roadrunner:/mnt/SDStorage#
root@roadrunner:/mnt/SDStorage#
root@roadrunner:/mnt/SDStorage# ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:37

eth0 Link encap:Ethernet HWaddr 00:04:25:12:34:56
inet addr:192.168.1.208 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::204:25ff:fe12:3456/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:435 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:78946 (77.0 KiB) TX bytes:1538 (1.5 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr fa:f0:05:f1:35:75
inet6 addr: fe80::f8f0:5ff:fef1:3575/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:878 (878.0 B)
root@roadrunner:/mnt/SDStorage#

Return to “SAMA5-based”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest