Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
* AT86RF212 based USB-Stick (HUL)
@ 2017-08-02 16:00 Josef Filzmaier
  2017-08-03  6:59 ` Stefan Schmidt
  0 siblings, 1 reply; 19+ messages in thread
From: Josef Filzmaier @ 2017-08-02 16:00 UTC (permalink / raw)
  To: linux-wpan

Hello everyone!

Disclaimer: I am new to kernel driver development

I'm trying to get the BUSWARE HUL stick [1] to work using the atusb driver.
I know this is not officially supported, but this stick is very similar to the 
rzusb stick which is stated work experimentally on the linux-wpan website.

I flashed the stick with the atben firmware using dfu-programmer and it seems to 
be working quite nicely.

I'm on Kernel 4.9 lts with arm architecture (raspberry pi b+)

I have modified the atusb driver to support the at86rf212 chip (inspired by the 
at86rf230 driver). It seems to be working just fine. I can configure the stick 
as i like with the iwpan tool, so the configuration over usb seems to be 
working. Also, i can see the wpan0 interface and can create a lowpan interface 
on top of it (as described on the lowpan website).

However, using the lowpan interface has no effect. No data gets sent over USB. 
I am able to capture the traffic using tshark, but the data never arrives at the 
atusb driver's atusb_xmit() function.

My idea currently is to put printk statements within the kernel to detect 
where the data gets lost. I can capture the data with wireshark so i should be 
able to find my calls somewhere in the kernel code.

Do you have any suggestions as to where i should start my debugging adventure? 
I cannot seem to find where a socket call is initiated and how it is propageted 
down to the driver level.

Any help welcome!

[1] http://www.busware.de/tiki-index.php?page=RF212USB

-- 
Josef Filzmaier

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: Re: AT86RF212 based USB-Stick (HUL)
@ 2017-08-03 14:26 Josef Filzmaier
  2017-08-03 15:50 ` Stefan Schmidt
  0 siblings, 1 reply; 19+ messages in thread
From: Josef Filzmaier @ 2017-08-03 14:26 UTC (permalink / raw)
  To: linux-wpan

> Does it use the exact same MCU to drive the transceiver?

It uses the AT90USB1287 so yes, they are the same.

> How did you verify that it works nicely? You said there is no USB 
communication going on.

There actually *is* USB communication going on. I can see it when capturing 
usb traffic and also in dmesg. The atusb_{write,read}_{reg,subreg} functions are 
working. I can read out information like part_num, version_num and man_id_x 
perfectly fine.
Setting channel, tx_power, pan_id etc are all working (or at least the 
communication over USB is working fine)

However, i do believe that the firmware is not fully capable of handling the 
incoming USB traffic. I will describe my problem in more detail at the bottom.

> Did you actually change anything in the firmware at all? Keep in mind that 
the firmware also has some parts of the send and receive logic which might need 
adaption for the 212 as well.

The only thing i have done in the firmware is that i have changed the the NAME 
parameter in the makefile to:
NAME = rzusb

> Hmm, 4.9 is a bit older and might miss some fixes from the stack. Any chance 
you could run that with a newer kernel? Its a USB device which could give you 
a way quicker development env on a normal desktop or laptop machine.

For me it is important that it runs on the raspberry pi with linux 4.9, but 
for development using a laptop/desktop could help out a lot that's true. I'm 
already cross compiling that is also helping a lot.
Maybe i will try it with a more recent development version of the kernel soon, 
just to be sure.

> Do you have the link to the code somewhere? Also the dmesg output of the 
atusb driver when inserting the usb stick would be interesting to see.

I have pushed my modified changes to github [1]. 
All i have done is added the part_num of the at86rf212 (7) case to the 
driver's probe function. (With the same calls as in the at86rf230 driver) Also 
i added the missing set_lbt function because i could not set the interface up 
otherwise. After those modifications there were no errors reported when probing 
the driver.

The full dmesg output when inserting the stick can be found here [2].
I also included the output of tshark with usbmon here [3].

*Detailed Problem Description:*

At the end of the dmesg output you can see that the atusb_xmit function is 
called and it seems to be completing. This is the _only_ atusb_xmit function 
call ever. It does only happen one single time, and then it never occurs 
again, even when actively using the network interface*. This is what makes me 
think:
  - Either the problem is higher up in the network stack. I am currently 
investigating this possibility (looking how sockets work in the kernel)
  - Or the problem occurs after the usb_submit_urb() function.

I do not think that this problem is within the firmware, but i might be wrong.

In either case, the transceiver never transmits any rf data over the 
transmission medium.

* I also have tested this with the at86rf212 transceiver connected directly 
via spi and it is working perfectly. i.e. the driver's xmit function is called 
for every network call.

Thanks!

[1] https://github.com/joseffilzmaier/linux/commit/
d0624efcceb8aa0911178f586d9b82dde5471570
[2] https://pastebin.com/HhzWJvea
[3] https://pastebin.com/HYpEK7LR

-- 
Josef Filzmaier

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <526ff7aa-6342-4a8e-8278-0d76d897044e@email.android.com>]

end of thread, other threads:[~2017-09-11 12:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 16:00 AT86RF212 based USB-Stick (HUL) Josef Filzmaier
2017-08-03  6:59 ` Stefan Schmidt
2017-08-03 13:44   ` Alexander Aring
  -- strict thread matches above, loose matches on Subject: below --
2017-08-03 14:26 Josef Filzmaier
2017-08-03 15:50 ` Stefan Schmidt
2017-08-03 20:51   ` Josef Filzmaier
2017-08-03 21:09     ` Stefan Schmidt
2017-08-16 15:33       ` Josef Filzmaier
2017-08-17  8:28         ` Josef Filzmaier
2017-08-17 10:13           ` Stefan Schmidt
2017-08-17 10:10         ` Stefan Schmidt
2017-08-17 11:14           ` Josef Filzmaier
2017-08-17 11:42             ` Stefan Schmidt
2017-08-18 10:26               ` Josef Filzmaier
2017-08-18 10:33                 ` Stefan Schmidt
2017-08-24 13:54                 ` Stefan Schmidt
     [not found] <526ff7aa-6342-4a8e-8278-0d76d897044e@email.android.com>
2017-08-29  7:30 ` Stefan Schmidt
2017-09-04 16:22   ` Josef Filzmaier
2017-09-11 11:13     ` Stefan Schmidt
2017-09-11 12:05       ` Josef Filzmaier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox