Exchange of the transceiver module on the SAMR21 Xplained Pro Platform

Hello everybody,

as part of my master thesis at the Karlsruhe Institute of Technology, I will connect a Powerline transceiver to the SAMR21 Xplained Pro platform. This one runs with RIOT OS. For the PLC transceiver, I develop the driver, which we also want to make open source.

The transceiver communicates with the host μC via API via UART. That means, the driver looks similar to the Xbee drivers from …/RIOT/drivers/xbee/.

After completion of the driver I would like to replace the AT86RF233 transceiver from SAM R21 Xplained Pro platform buy PLC transceiver.

Unfortunately, until now I can’t figure out how to do that. Is there any documentation that you could recommend?

I have read all the tutorials and how-tos as well as documentation that I have found so far. I know that a driver is a module and I know how to assign a module such as shell to the makefile of some application. In the makefile.dep of the board I found the following:

ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))

USEMODULE += at86rf233

Endif

I guess I need to replace this and the SPI assignments in the bord.h. Is that right?

I would be very grateful for your help.

Best regards,

Friedrich Wiegel

Hi Friedrich,

acutally what you want to do is quite simple. You actually don’t even need to exchange the transceiver, you could as well run your system with both of them, the at86rf + your PLC transceivers.

So if you take the gnrc_networking example as a base, and say that your PLC driver comes with all the neccessary auto_init code and board configuration (more of this below), all you need to do is:

USEMODULE=YOUR_PLC_DRIVER_NAME_HERE BOARD=samr21-xpro make all

This will build the GNRC networking example and link your PLC transceiver right in.

Now about the auto_init code: have a look at the auto_init code for the at86rf transcevier (-> sys/auto_init/netif/auto_init_at86rf2xx.c), or maybe also the code for the enc28j60 (Ethernet), as this might be closer to your PLC device. This is what you have to implement for your PLC device as well.

Regarding the parameters for your PLC driver: have a look at the device driver development guide [1], especially the part about the default parameter file. This should give you all the information you need.

Hope this is what you were looking for and happy hacking, Hauke

[1]

Hi,

Hi Friedrich,

acutally what you want to do is quite simple. You actually don't even need to exchange the transceiver, you could as well run your system with both of them, the at86rf + your PLC transceivers.

So if you take the gnrc_networking example as a base, and say that your PLC driver comes with all the neccessary auto_init code and board configuration (more of this below), all you need to do is:

USEMODULE=YOUR_PLC_DRIVER_NAME_HERE BOARD=samr21-xpro make all

This will build the GNRC networking example and link your PLC transceiver right in.

One small addition to that: you also need to increase the number of interfaces in GNRC, otherwise GNRC will just pick-up one of the devices:

USEMODULE=YOUR_PLC_DRIVER_NAME_HERE CFLAGS=-DGNRC_NETIF_NUMOF=2

BOARD=samr21-xpro make all

Cheers, Martine

@Hauke, @Martine,

thanks a lot both of you. I will follow your instruction as soon as I am so far.

One another question. I would like to understand how the OS is built on. This means, how the single files related to each other or how the entire structure looks like. In the rough I understand that, but many times, I have to try and failed to find it out how things relate to each other.

Are there any lecture scripts or notes, which describe the structure of the RIOT os in detail?

Best regards,

Friedrich

Hi,

as stated above, I want to connect a powerline transceiver to samr21 Xplained Pro platform which run with RIOT OS. The Powerline transceiver is a proprietary development of the KIT, which one was developed within research work and is therefore equipped only with minimal functionalities. That means, it can only simply send and receive data. All other functions, e.g. CCA or CSMA / CA must be adopted by the software MAC.

As I understood it from 1 and 2, it is possible with the GNRC Network Stack.

That means, I can equip a very simple transceiver through the GNRC Network Stack with MAC features such as PAN setup and management as well as media access functions like CCA and CSMA / CA.

Is that correct?

Best regards,

Friedrich