Skip to contentSkip to conversation

issues with at86rf212b transceiver

DISCUSSION [email protected] 2 participants 9 messages Feb 17, 2018 – Feb 18, 2018 IEEE 802.15.4

lore
Share & tools
lore
#0 lore raw

Hi

I have a transceiver at86rf212b connected to Atmel's SAMA5D2-XULT devboard. It runs kernel from Atmel, based on Linux release 4.9. Maybe it's not a latest one, but I checked that there are no significant changes to at86rf230 driver since then.

So I have some issues with transceiver and at86rf230 driver module. Is this driver considered production-ready, was it tested with at86rf212b?

I turn on two devboards with transceiver attached, both have same linux distro with same kernel version and wpan-tools.

device tree snippet:

                        spi1: spi@fc000000 {
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_spi1_default>;
                                transceiver@0 {
                                        compatible = "atmel,at86rf212";
                                        spi-max-frequency = <7500000>;
                                        reg = <0>;
                                        interrupt-parent = <&pioA>;
                                        interrupts = <109 GPIO_ACTIVE_HIGH>;
                                        reset-gpio = <&pioA 41 GPIO_ACTIVE_LOW>;
                                        sleep-gpio =<&pioA 125 GPIO_ACTIVE_HIGH>;
                                        status = "okay";
                                        pinctrl-names = "default";
                                        pinctrl-0 = <&pinctrl_transceiver_irq &pinctrl_transceiver_rst &pinctrl_transceiver_slp>;
                                };
                        };

                        flx4: flexcom@fc018000 {

                                i2c2: i2c@600 {
                                        status = "disable"; /* conflicts with transceiver, pin PD13 */
                                };
                        };

                        pinctrl@fc038000 {
                                pinctrl_spi1_default: spi1_default {
                                        pinmux = <PIN_PD25__SPI1_SPCK>,
                                                 <PIN_PD26__SPI1_MOSI>,
                                                 <PIN_PD27__SPI1_MISO>,
                                                 <PIN_PD28__SPI1_NPCS0>;
                                        bias-disable;
                                };

                                pinctrl_transceiver_irq: transceiver_irq {
                                        pinmux = <PIN_PD13__GPIO>;
                                        bias-disable;
                                };

                                pinctrl_transceiver_rst: transceiver_rst {
                                        pinmux = <PIN_PB9__GPIO>;
                                        bias-pull-up;
                                };

                                pinctrl_transceiver_slp: transceiver_slp {
                                        pinmux = <PIN_PD29__GPIO>;
                                        bias-disable;
                                };

When I try to enable lowpan interface, I get lot of kernel messages in console, on both
devices, then kernel messages stop and no data is exchanged, sent and received bytes counters displayed by ifconfig do not update no matter what I try (wpan-ping, ping6, etc). Seems that driver hangs or deadlocks after kernel messages

at86rf230 spi32765.0: not supported irq 84 received at86rf230 spi32765.0: not supported irq 80 received

buildroot login: root

# iwpan phy phy0 set channel 0 0
# iwpan dev wpan0 set pan_id 0xbeef
# iwpan dev wpan0 set short_addr 0x0002
# ip link add link wpan0 name lowpan0 type lowpan
# ip link set wpan0 up
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x16. Actual state: 0x01
# at86rf230 spi32765.0: not supported irq 84 received
------------[ cut here ]------------
WARNING: CPU: 0 PID: 61 at drivers/net/ieee802154/at86rf230.c:754 0xc0442528
received rx trac status 4
Modules linked in: ov7670 atmel_usba_udc
CPU: 0 PID: 61 Comm: spi32765 Not tainted 4.9.52-linux4sam_5.7 #1
Hardware name: Atmel SAMA5
Function entered at [<c010ce64>] from [<c010a6c4>]
Function entered at [<c010a6c4>] from [<c0116744>]
Function entered at [<c0116744>] from [<c0116794>]
Function entered at [<c0116794>] from [<c0442528>]
Function entered at [<c0442528>] from [<c042ceec>]
Function entered at [<c042ceec>] from [<c042b5f0>]
Function entered at [<c042b5f0>] from [<c012f268>]
Function entered at [<c012f268>] from [<c012f138>]
Function entered at [<c012f138>] from [<c0107458>]
---[ end trace 8d01f5f6ebae868e ]---
at86rf230 spi32765.0: not supported irq 80 received
# ifconfig
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)

wpan0 Link encap:UNSPEC HWaddr 9A-54-66-3E-CC-20-1B-3B-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING NOARP MTU:123 Metric:1 RX packets:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300
RX bytes:107 (107.0 B) TX bytes:0 (0.0 B)

# ip link set lowpan0 up
# at86rf230 spi32765.0: unexcept state change from 0x0b to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x19. Actual state: 0x01
at86rf230 spi32765.0: not supported irq 80 received
------------[ cut here ]------------
WARNING: CPU: 0 PID: 61 at drivers/net/ieee802154/at86rf230.c:696 0xc0442644
received tx trac status 4
Modules linked in: ov7670 atmel_usba_udc
CPU: 0 PID: 61 Comm: spi32765 Tainted: G        W       4.9.52-linux4sam_5.7 #1
Hardware name: Atmel SAMA5
Function entered at [<c010ce64>] from [<c010a6c4>]
Function entered at [<c010a6c4>] from [<c0116744>]
Function entered at [<c0116744>] from [<c0116794>]
Function entered at [<c0116794>] from [<c0442644>]
Function entered at [<c0442644>] from [<c042ceec>]
Function entered at [<c042ceec>] from [<c042b5f0>]
Function entered at [<c042b5f0>] from [<c012f268>]
Function entered at [<c012f268>] from [<c012f138>]
Function entered at [<c012f138>] from [<c0107458>]
---[ end trace 8d01f5f6ebae868f ]---
at86rf230 spi32765.0: unexcept state change from 0x0c to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x16. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x0b to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x19. Actual state: 0x01
at86rf230 spi32765.0: not supported irq 84 received
at86rf230 spi32765.0: not supported irq 80 received
# ifconfig
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)

lowpan0 Link encap:UNSPEC HWaddr 9A-54-66-3E-CC-20-1B-3B-00-00-00-00-00-00-00-00
inet6 addr: fe80::9854:663e:cc20:1b3b/64 Scope:Link inet6 addr: fe80::bcef:ff:fe00:2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1280 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:584 (584.0 B)

wpan0 Link encap:UNSPEC HWaddr 9A-54-66-3E-CC-20-1B-3B-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING NOARP MTU:123 Metric:1 RX packets:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300
RX bytes:107 (107.0 B) TX bytes:111 (111.0 B)

maintainer
#1 lore raw

Hi,

2018-02-17 13:41 GMT-05:00 <[email protected]>:

Quoted 9 lines

Hi

I have a transceiver at86rf212b connected to Atmel's SAMA5D2-XULT devboard. It runs kernel from Atmel, based on Linux release 4.9. Maybe it's not a latest one, but I checked that there are no significant changes to at86rf230 driver since then.

So I have some issues with transceiver and at86rf230 driver module. Is this driver considered production-ready, was it tested with at86rf212b?

So far I know somebody already use the driver with an at86rf212b - there was patches related to that.

What do you mean with "production-ready"? GPL gives you no warranty and we do it as "hobby"...

According your problem, show me "cat /proc/interrupts" I will see if the interrupt is fired (more than one time), otherwise I see a board setup problem...

- Alex

#2 lore raw
Quoted 16 lines · Alexander Aring

Hi,

2018-02-17 13:41 GMT-05:00 <[email protected]>:

Quoted 9 lines

Hi

I have a transceiver at86rf212b connected to Atmel's SAMA5D2-XULT devboard. It runs kernel from Atmel, based on Linux release 4.9. Maybe it's not a latest one, but I checked that there are no significant changes to at86rf230 driver since then.

So I have some issues with transceiver and at86rf230 driver module. Is this driver considered production-ready, was it tested with at86rf212b?

So far I know somebody already use the driver with an at86rf212b - there was patches related to that.

Quoted 8 lines

What do you mean with "production-ready"? GPL gives you no warranty and we do it as "hobby"...

According your problem, show me "cat /proc/interrupts" I will see if the interrupt is fired (more than one time), otherwise I see a board setup problem...

- Alex

Hi Alex,

Of course I understand about no warranty, just asking. Quality of drivers accepted into mainline kernely may vary, especially for rare hardware. I am ready to cooperate and help with improving this driver.

Btw, I've googled thread from this mailing list
https://www.spinics.net/lists/linux-wpan/msg02555.html
"ping6 doesn't use at86rf230 driver"
with somewhat similar issues, but it was spi driver's fault. Not sure if it's the same reason here, any ideas?

Ok, so I've started one of the dev board, looks like 12 interrupts are fired, then something breaks and seems no more frames are sent, as interrupts count does not update and TX bytes value of wpan0 remains 352

Interrupt line from /proc/interrupts should be this one:
161: 0 GPIO 109 Level spi32765.0

at86rf230 spi32765.0: Detected at86rf212 chip version 3
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x08. Actual state: 0x01

<skipped..>

Welcome to Buildroot
buildroot login: root

# cat /proc/interrupts 
           CPU0       
 16:        134  atmel-aic5   3 Level     at91_tick
 18:          0  atmel-aic5  42 Level     atmel_usba_udc
 19:          1  atmel-aic5  41 Level     ehci_hcd:usb1, ohci_hcd:usb2
 21:        344  atmel-aic5  31 Level     mmc0
 22:        689  atmel-aic5  32 Level     mmc1
 23:          0  atmel-aic5  46 Level     atmel_isc
 24:         40  atmel-aic5   6 Level     at_xdmac
 25:          0  atmel-aic5   7 Level     at_xdmac
 26:          1  atmel-aic5  74 Level     at91_rtc
 27:          0  atmel-aic5  12 Level     atmel-sha
 28:          0  atmel-aic5   9 Level     atmel-aes
 29:          8  atmel-aic5  33 Level     f8000000.spi
 30:          0  atmel-aic5   5 Level     eth0
 31:          0  atmel-aic5  66 Level     eth0
 32:          0  atmel-aic5  67 Level     eth0
 33:        583  atmel-aic5  35 Level     tc_clkevt
 35:        116  atmel-aic5  25 Level     ttyS0
 36:       1985  atmel-aic5  29 Level     f8028000.i2c
 40:         37  atmel-aic5  34 Level     fc000000.spi
 42:         34  atmel-aic5  30 Level     fc028000.i2c
 43:          0  atmel-aic5  40 Level     at91-sama5d2_adc
 48:          0  atmel-aic5  11 Level     atmel-tdes
 83:          0      GPIO  31 Edge      atmel_usba_udc
 97:          0      GPIO  45 Edge      act8945a_interrupt
124:          0      GPIO  72 Edge      act8945a_lbo_detect
125:          0      GPIO  73 Level     phy_interrupt
161:          0      GPIO 109 Level     spi32765.0
Err:          0
# random: crng init done
# iwpan phy phy0 set channel 0 0
# iwpan dev wpan0 set pan_id 0xbeef
# iwpan dev wpan0 set short_addr 0x0001
# ip link add link wpan0 name lowpan0 type lowpan
# ip link set wpan0 up
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x16. Actual state: 0x01
# cat /proc/interrupts 
           CPU0       
 16:        134  atmel-aic5   3 Level     at91_tick
 18:          0  atmel-aic5  42 Level     atmel_usba_udc
 19:          1  atmel-aic5  41 Level     ehci_hcd:usb1, ohci_hcd:usb2
 21:        344  atmel-aic5  31 Level     mmc0
 22:       1114  atmel-aic5  32 Level     mmc1
 23:          0  atmel-aic5  46 Level     atmel_isc
 24:        190  atmel-aic5   6 Level     at_xdmac
 25:          0  atmel-aic5   7 Level     at_xdmac
 26:          1  atmel-aic5  74 Level     at91_rtc
 27:          0  atmel-aic5  12 Level     atmel-sha
 28:          0  atmel-aic5   9 Level     atmel-aes
 29:          8  atmel-aic5  33 Level     f8000000.spi
 30:          0  atmel-aic5   5 Level     eth0
 31:          0  atmel-aic5  66 Level     eth0
 32:          0  atmel-aic5  67 Level     eth0
 33:       3438  atmel-aic5  35 Level     tc_clkevt
 35:        701  atmel-aic5  25 Level     ttyS0
 36:       1985  atmel-aic5  29 Level     f8028000.i2c
 40:         62  atmel-aic5  34 Level     fc000000.spi
 42:         34  atmel-aic5  30 Level     fc028000.i2c
 43:          0  atmel-aic5  40 Level     at91-sama5d2_adc
 48:          0  atmel-aic5  11 Level     atmel-tdes
 83:          0      GPIO  31 Edge      atmel_usba_udc
 97:          0      GPIO  45 Edge      act8945a_interrupt
124:          0      GPIO  72 Edge      act8945a_lbo_detect
125:          0      GPIO  73 Level     phy_interrupt
161:          0      GPIO 109 Level     spi32765.0
Err:          0
# ip link set lowpan0 up
# at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x19. Actual state: 0x0c
at86rf230 spi32765.0: not supported irq 84 received
------------[ cut here ]------------
WARNING: CPU: 0 PID: 61 at drivers/net/ieee802154/at86rf230.c:696 0xc0442644
received tx trac status 4
Modules linked in: ov7670 atmel_usba_udc
CPU: 0 PID: 61 Comm: spi32765 Not tainted 4.9.52-linux4sam_5.7 #1
Hardware name: Atmel SAMA5
Function entered at [<c010ce64>] from [<c010a6c4>]
Function entered at [<c010a6c4>] from [<c0116744>]
Function entered at [<c0116744>] from [<c0116794>]
Function entered at [<c0116794>] from [<c0442644>]
Function entered at [<c0442644>] from [<c042ceec>]
Function entered at [<c042ceec>] from [<c042b5f0>]
Function entered at [<c042b5f0>] from [<c012f268>]
Function entered at [<c012f268>] from [<c012f138>]
Function entered at [<c012f138>] from [<c0107458>]
---[ end trace f3c9010c70b3c7af ]---
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x16. Actual state: 0x0b
at86rf230 spi32765.0: unexcept state change from 0x0b to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x19. Actual state: 0x01
at86rf230 spi32765.0: not supported irq 84 received
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x16. Actual state: 0x0b
at86rf230 spi32765.0: unexcept state change from 0x0b to 0x09. Actual state: 0x04
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x19. Actual state: 0x01
------------[ cut here ]------------
WARNING: CPU: 0 PID: 61 at drivers/net/ieee802154/at86rf230.c:754 0xc0442528
received rx trac status 4
Modules linked in: ov7670 atmel_usba_udc
CPU: 0 PID: 61 Comm: spi32765 Tainted: G        W       4.9.52-linux4sam_5.7 #1
Hardware name: Atmel SAMA5
Function entered at [<c010ce64>] from [<c010a6c4>]
Function entered at [<c010a6c4>] from [<c0116744>]
Function entered at [<c0116744>] from [<c0116794>]
Function entered at [<c0116794>] from [<c0442528>]
Function entered at [<c0442528>] from [<c042ceec>]
Function entered at [<c042ceec>] from [<c042b5f0>]
Function entered at [<c042b5f0>] from [<c012f268>]
Function entered at [<c012f268>] from [<c012f138>]
Function entered at [<c012f138>] from [<c0107458>]
---[ end trace f3c9010c70b3c7b0 ]---
at86rf230 spi32765.0: unexcept state change from 0x0c to 0x09. Actual state: 0x04
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x16. Actual state: 0x0b
at86rf230 spi32765.0: unexcept state change from 0x0b to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x19. Actual state: 0x01
at86rf230 spi32765.0: not supported irq 80 received
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x16. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x04
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x19. Actual state: 0x0c
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x16. Actual state: 0x0b
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x09. Actual state: 0x01
at86rf230 spi32765.0: unexcept state change from 0x04 to 0x19. Actual state: 0x01
at86rf230 spi32765.0: not supported irq 84 received
at86rf230 spi32765.0: not supported irq 80 received
# cat /proc/interrupts 
           CPU0       
 16:        134  atmel-aic5   3 Level     at91_tick
 18:          0  atmel-aic5  42 Level     atmel_usba_udc
 19:          1  atmel-aic5  41 Level     ehci_hcd:usb1, ohci_hcd:usb2
 21:        344  atmel-aic5  31 Level     mmc0
 22:       1211  atmel-aic5  32 Level     mmc1
 23:          0  atmel-aic5  46 Level     atmel_isc
 24:        252  atmel-aic5   6 Level     at_xdmac
 25:          0  atmel-aic5   7 Level     at_xdmac
 26:          1  atmel-aic5  74 Level     at91_rtc
 27:          0  atmel-aic5  12 Level     atmel-sha
 28:          0  atmel-aic5   9 Level     atmel-aes
 29:          8  atmel-aic5  33 Level     f8000000.spi
 30:          0  atmel-aic5   5 Level     eth0
 31:          0  atmel-aic5  66 Level     eth0
 32:          0  atmel-aic5  67 Level     eth0
 33:       4110  atmel-aic5  35 Level     tc_clkevt
 35:        886  atmel-aic5  25 Level     ttyS0
 36:       1985  atmel-aic5  29 Level     f8028000.i2c
 40:        147  atmel-aic5  34 Level     fc000000.spi
 42:         34  atmel-aic5  30 Level     fc028000.i2c
 43:          0  atmel-aic5  40 Level     at91-sama5d2_adc
 48:          0  atmel-aic5  11 Level     atmel-tdes
 83:          0      GPIO  31 Edge      atmel_usba_udc
 97:          0      GPIO  45 Edge      act8945a_interrupt
124:          0      GPIO  72 Edge      act8945a_lbo_detect
125:          0      GPIO  73 Level     phy_interrupt
161:         12      GPIO 109 Level     spi32765.0
Err:          0
# ifconfig
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)

lowpan0 Link encap:UNSPEC HWaddr D6-60-8E-A9-17-93-48-5C-00-00-00-00-00-00-00-00
inet6 addr: fe80::d460:8ea9:1793:485c/64 Scope:Link inet6 addr: fe80::bcef:ff:fe00:1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1280 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:728 (728.0 B)

wpan0 Link encap:UNSPEC HWaddr D6-60-8E-A9-17-93-48-5C-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING NOARP MTU:123 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300
RX bytes:0 (0.0 B) TX bytes:352 (352.0 B)

# wpan-ping -a 0x0002
PING 0x0002 (PAN ID 0xbeef) 5 data bytes
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
Hit 500 ms packet timeout
^C
# cat /proc/interrupts 
           CPU0       
 16:        134  atmel-aic5   3 Level     at91_tick
 18:          0  atmel-aic5  42 Level     atmel_usba_udc
 19:          1  atmel-aic5  41 Level     ehci_hcd:usb1, ohci_hcd:usb2
 21:        344  atmel-aic5  31 Level     mmc0
 22:       1346  atmel-aic5  32 Level     mmc1
 23:          0  atmel-aic5  46 Level     atmel_isc
 24:        307  atmel-aic5   6 Level     at_xdmac
 25:          0  atmel-aic5   7 Level     at_xdmac
 26:          1  atmel-aic5  74 Level     at91_rtc
 27:          0  atmel-aic5  12 Level     atmel-sha
 28:          0  atmel-aic5   9 Level     atmel-aes
 29:          8  atmel-aic5  33 Level     f8000000.spi
 30:          0  atmel-aic5   5 Level     eth0
 31:          0  atmel-aic5  66 Level     eth0
 32:          0  atmel-aic5  67 Level     eth0
 33:       4843  atmel-aic5  35 Level     tc_clkevt
 35:       1035  atmel-aic5  25 Level     ttyS0
 36:       1985  atmel-aic5  29 Level     f8028000.i2c
 40:        147  atmel-aic5  34 Level     fc000000.spi
 42:         34  atmel-aic5  30 Level     fc028000.i2c
 43:          0  atmel-aic5  40 Level     at91-sama5d2_adc
 48:          0  atmel-aic5  11 Level     atmel-tdes
 83:          0      GPIO  31 Edge      atmel_usba_udc
 97:          0      GPIO  45 Edge      act8945a_interrupt
124:          0      GPIO  72 Edge      act8945a_lbo_detect
125:          0      GPIO  73 Level     phy_interrupt
161:         12      GPIO 109 Level     spi32765.0
Err:          0
# ifconfig
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)

lowpan0 Link encap:UNSPEC HWaddr D6-60-8E-A9-17-93-48-5C-00-00-00-00-00-00-00-00
inet6 addr: fe80::d460:8ea9:1793:485c/64 Scope:Link inet6 addr: fe80::bcef:ff:fe00:1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1280 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:944 (944.0 B)

wpan0 Link encap:UNSPEC HWaddr D6-60-8E-A9-17-93-48-5C-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING NOARP MTU:123 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300
RX bytes:0 (0.0 B) TX bytes:352 (352.0 B)

#

maintainer
#3 lore raw

Hi,

2018-02-18 10:21 GMT-05:00 <[email protected]>:

Quoted 32 lines · Alexander Aring
Quoted 16 lines

Hi,

2018-02-17 13:41 GMT-05:00 <[email protected]>:

Quoted 9 lines

Hi

I have a transceiver at86rf212b connected to Atmel's SAMA5D2-XULT devboard. It runs kernel from Atmel, based on Linux release 4.9. Maybe it's not a latest one, but I checked that there are no significant changes to at86rf230 driver since then.

So I have some issues with transceiver and at86rf230 driver module. Is this driver considered production-ready, was it tested with at86rf212b?

So far I know somebody already use the driver with an at86rf212b - there was patches related to that.

Quoted 8 lines

What do you mean with "production-ready"? GPL gives you no warranty and we do it as "hobby"...

According your problem, show me "cat /proc/interrupts" I will see if the interrupt is fired (more than one time), otherwise I see a board setup problem...

- Alex

Hi Alex,

Of course I understand about no warranty, just asking. Quality of drivers accepted into mainline kernely may vary, especially for rare hardware. I am ready to cooperate and help with improving this driver.

Quoted 6 lines

Btw, I've googled thread from this mailing list
https://www.spinics.net/lists/linux-wpan/msg02555.html
"ping6 doesn't use at86rf230 driver"
with somewhat similar issues, but it was spi driver's fault. Not sure if it's the same reason here, any ideas?

no, I mean another patch...

7598968d6fdbe8960b941246cc6ebef725899c59

Tested on AT86RF212B where the part is detected to be the expected part...

it makes probing working and so far I know it was working.

Quoted 7 lines

Ok, so I've started one of the dev board, looks like 12 interrupts are fired, then something breaks and seems no more frames are sent, as interrupts count does not update and TX bytes value of wpan0 remains 352

Interrupt line from /proc/interrupts should be this one:
161: 0 GPIO 109 Level spi32765.0

ok good.

Quoted 3 lines

at86rf230 spi32765.0: Detected at86rf212 chip version 3
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x08. Actual state: 0x01

....

Quoted 2 lines

at86rf230 spi32765.0: not supported irq 84 received

This messages confused me, it should not happen unless you reading/writing garbage on SPI bus.
We only use IRQ TRX_END and we are sure that we only receive these IRQs by IRQ_MASK_MODE and IRQ_MASK.

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

- Alex

maintainer
#4 lore raw

Hi,

2018-02-18 10:40 GMT-05:00 Alexander Aring <[email protected]>:

Quoted 74 lines

Hi,

2018-02-18 10:21 GMT-05:00 <[email protected]>:

Quoted 32 lines · Alexander Aring
Quoted 16 lines

Hi,

2018-02-17 13:41 GMT-05:00 <[email protected]>:

Quoted 9 lines

Hi

I have a transceiver at86rf212b connected to Atmel's SAMA5D2-XULT devboard. It runs kernel from Atmel, based on Linux release 4.9. Maybe it's not a latest one, but I checked that there are no significant changes to at86rf230 driver since then.

So I have some issues with transceiver and at86rf230 driver module. Is this driver considered production-ready, was it tested with at86rf212b?

So far I know somebody already use the driver with an at86rf212b - there was patches related to that.

Quoted 8 lines

What do you mean with "production-ready"? GPL gives you no warranty and we do it as "hobby"...

According your problem, show me "cat /proc/interrupts" I will see if the interrupt is fired (more than one time), otherwise I see a board setup problem...

- Alex

Hi Alex,

Of course I understand about no warranty, just asking. Quality of drivers accepted into mainline kernely may vary, especially for rare hardware. I am ready to cooperate and help with improving this driver.

Quoted 6 lines

Btw, I've googled thread from this mailing list
https://www.spinics.net/lists/linux-wpan/msg02555.html
"ping6 doesn't use at86rf230 driver"
with somewhat similar issues, but it was spi driver's fault. Not sure if it's the same reason here, any ideas?

no, I mean another patch...

7598968d6fdbe8960b941246cc6ebef725899c59

Tested on AT86RF212B where the part is detected to be the expected part...

it makes probing working and so far I know it was working.

Quoted 7 lines

Ok, so I've started one of the dev board, looks like 12 interrupts are fired, then something breaks and seems no more frames are sent, as interrupts count does not update and TX bytes value of wpan0 remains 352

Interrupt line from /proc/interrupts should be this one:
161: 0 GPIO 109 Level spi32765.0

ok good.

Quoted 3 lines

at86rf230 spi32765.0: Detected at86rf212 chip version 3
at86rf230 spi32765.0: unexcept state change from 0x01 to 0x08. Actual state: 0x01

....

Quoted 2 lines

at86rf230 spi32765.0: not supported irq 84 received

This messages confused me, it should not happen unless you reading/writing garbage on SPI bus.
We only use IRQ TRX_END and we are sure that we only receive these IRQs by IRQ_MASK_MODE and IRQ_MASK.

Quoted 5 lines

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

You can try to read registers with debugfs and regmap entry... and look if the registers are the same as hw_init in the driver... if not something weird going on e.g. lossy connection, too high spi-clock, magnetic field, moon position, etc.

- Alex

#5 lore raw
Quoted 13 lines
Quoted 7 lines
Quoted 1 line

This messages confused me, it should not happen unless you reading/writing garbage on SPI bus.
We only use IRQ TRX_END and we are sure that we only receive these IRQs by IRQ_MASK_MODE and IRQ_MASK.

Quoted 5 lines

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

Quoted 6 lines

You can try to read registers with debugfs and regmap entry... and look if the registers are the same as hw_init in the driver... if not something weird going on e.g. lossy connection, too high spi-clock, magnetic field, moon position, etc.

- Alex

Okay, seems like hardware issue, wiring and connectors on the devboard are not high frequency friendly.

I tried to lower spi frequency from 7.5MHz to 4, then 2 and 1. Most messages disappeared after switching to 4MHz, but there were still these ones

at86rf230 spi32765.0: not supported irq 80 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received

After switching to 1MHz I got only these ones, but many of them, probably one per packet or more

at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received

Now I am able to do wpan-ping and even ssh over IPv6 from one device to another. Thanks for your advices.

Now question is, what is the lowest possible spi frequency still suitable for data transfers at 40kbps?

I also tried to change IRQ pin bias settings in device tree from "bias-disable" to "bias-pull-down", I thought maybe there are spurious interrupts triggered by interference, but it did not help.

maintainer
#6 lore raw

Hi,

2018-02-18 12:36 GMT-05:00 <[email protected]>:

Quoted 34 lines
Quoted 13 lines
Quoted 7 lines
Quoted 1 line

This messages confused me, it should not happen unless you reading/writing garbage on SPI bus.
We only use IRQ TRX_END and we are sure that we only receive these IRQs by IRQ_MASK_MODE and IRQ_MASK.

Quoted 5 lines

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

Quoted 6 lines

You can try to read registers with debugfs and regmap entry... and look if the registers are the same as hw_init in the driver... if not something weird going on e.g. lossy connection, too high spi-clock, magnetic field, moon position, etc.

- Alex

Okay, seems like hardware issue, wiring and connectors on the devboard are not high frequency friendly.

I tried to lower spi frequency from 7.5MHz to 4, then 2 and 1. Most messages disappeared after switching to 4MHz, but there were still these ones

at86rf230 spi32765.0: not supported irq 80 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received

After switching to 1MHz I got only these ones, but many of them, probably one per packet or more

Quoted 8 lines

at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received

Now I am able to do wpan-ping and even ssh over IPv6 from one device to another. Thanks for your advices.

ok.

Quoted 3 lines

Now question is, what is the lowest possible spi frequency still suitable for data transfers at 40kbps?

datasheet doesn't say anything about lowest frequency...

Quoted 5 lines

I also tried to change IRQ pin bias settings in device tree from "bias-disable" to "bias-pull-down", I thought maybe there are spurious interrupts triggered by interference, but it did not help.

I suppose your spi controller is buggy, we had the same with the rpi kernel and mainline rpi was always working fine. I getting boring, always people have spi hardware issues and complaining here. We don't/can't fix these issues...

- Alex

#7 lore raw
In reply to Alexander Aring
Quoted 7 lines · Alexander Aring
Quoted 6 lines

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

Quoted 6 lines

You can try to read registers with debugfs and regmap entry... and look if the registers are the same as hw_init in the driver... if not something weird going on e.g. lossy connection, too high spi-clock, magnetic field, moon position, etc.

- Alex

I set SPI clock to 500 000, still have

at86rf230 spi32765.0: not supported irq 00 received

probably it is an IRQ pin wiring issue, not SPI frequency.

I am trying to do wpan-ping and ping over IPv6,
ping values seem too high for devices located on the same table and IPv6 ping has more than double RTT time, maybe it is due to protocol overhead and so on, but does 45ms for wpan-ping look normal?

# wpan-ping -a 0x0002
PING 0x0002 (PAN ID 0xbeef) 5 data bytes
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=0 time=59.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=1 time=44.5 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=2 time=59.8 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=3 time=57.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=4 time=47.0 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=5 time=57.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=6 time=43.6 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
# at86rf230 spi32765.0: not supported irq 00 received
# ping -6 fe80::bcef:ff:fe00:2%lowpan0at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received

PING fe80::bcef:ff:fe00:2%lowpan0(fe80::bcef:ff:fe00:2) 56 data bytes at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=2 ttl=64 time=105 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=3 ttl=64 time=109 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=4 ttl=64 time=109 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=5 ttl=64 time=114 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
^C
--- fe80::bcef:ff:fe00:2%lowpan0 ping statistics ---
6 packets transmitted, 4 received, 33% packet loss, time 5033ms rtt min/avg/max/mdev = 105.572/109.775/114.680/3.239 ms

# at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
maintainer
#8 lore raw

Hi,

2018-02-18 14:04 GMT-05:00 <[email protected]>:

Quoted 86 lines · Alexander Aring
Quoted 7 lines
Quoted 6 lines

Check your wiring, make a lower spi clock (Maybe we should make the clock at the devicetree documentation lower).

But... this messages should not happen unless something is broken.

Quoted 6 lines

You can try to read registers with debugfs and regmap entry... and look if the registers are the same as hw_init in the driver... if not something weird going on e.g. lossy connection, too high spi-clock, magnetic field, moon position, etc.

- Alex

I set SPI clock to 500 000, still have

at86rf230 spi32765.0: not supported irq 00 received

probably it is an IRQ pin wiring issue, not SPI frequency.

I am trying to do wpan-ping and ping over IPv6,
ping values seem too high for devices located on the same table and IPv6 ping has more than double RTT time, maybe it is due to protocol overhead and so on, but does 45ms for wpan-ping look normal?

# wpan-ping -a 0x0002
PING 0x0002 (PAN ID 0xbeef) 5 data bytes
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=0 time=59.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=1 time=44.5 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=2 time=59.8 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=3 time=57.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=4 time=47.0 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=5 time=57.9 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
5 bytes from 0x0002 seq=6 time=43.6 ms
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
# at86rf230 spi32765.0: not supported irq 00 received
# ping -6 fe80::bcef:ff:fe00:2%lowpan0at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received

PING fe80::bcef:ff:fe00:2%lowpan0(fe80::bcef:ff:fe00:2) 56 data bytes at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=2 ttl=64 time=105 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=3 ttl=64 time=109 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=4 ttl=64 time=109 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
64 bytes from fe80::bcef:ff:fe00:2: icmp_seq=5 ttl=64 time=114 ms at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received at86rf230 spi32765.0: not supported irq 00 received
^C
--- fe80::bcef:ff:fe00:2%lowpan0 ping statistics ---
6 packets transmitted, 4 received, 33% packet loss, time 5033ms rtt min/avg/max/mdev = 105.572/109.775/114.680/3.239 ms

Quoted 4 lines
# at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received
at86rf230 spi32765.0: not supported irq 00 received

definitely the irq line, it is triggered and IRQ_STATUS says "no irq signaled". This is cleaned only if you read irq stats out.

- Alex