-
Notifications
You must be signed in to change notification settings - Fork 2k
Tutorial: How to port a radio module driver to RIOT OS
Nenaco edited this page Jul 27, 2016
·
24 revisions
Attention: Work in progress (content is coming step by step / feel free and make corrections and add your experience)
The intention for this page is just to give RIOT newbies a guide to develop or port a driver for their prefered radio module. In fact there are actually many boards supported by RIOT OS but only a few radio modules. Maybe this page can help to change the situation.
- First: You need two pieces of hardware - at least one microcontroller board (well known to work with RIOT) and the Radio Module for which you want to write the software driver. Blind programming (without having the hardware) maybe interesting, but doesn't really make sense....
- Be shure you have all the documents of the module (which provides you information about connecting the module to the big wide world) and also from the silicon (chip datasheet, manual, application notes which can provide you information about protocols, timings, register-sets and so on...)
- You need a working toolchain and a working programming environment / IDE (e.g. Eclipse)
- You need a hardware emulation probe which provides you the possibily to programm your firmware onto the microcontroller-board and which provides you the possibility to trace through the code....
- And last, but not least you probably need an oscilloscope for measuring the traffic which is going on between the microcontroller board and the radio module (or should I say - "which should go on between....")
- Take a look into the code of software-drivers which could be used as a blue-print for your own driver. In the case of a **netdev2-radio-driver** this could be the code for the Atmel at86rf2xx family. The datasheet for this piece of silicon would be also helpful to understand what's going in in this driver - if not all parts are described in this tutorial ;-)
- Stick together your hardware parts (microcontroller-board and radio-module). Most of the radio modules are using an SPI-Interface as the communication pipeline between the microcontroller and the radio-module. But don't forget the other necessary signals (chip-select(s), reset-line, interrupt-line(s), wake/sleep e.g.) and Last but not least the power-supply (VCC, GND).
- Preview:
- Which directories have to be created?
- Preview:
The following file have to be created or copied from another driver
~/RIOT/drivers/<driver-name>/<driver-name>_internal.c ~/RIOT/drivers/<driver-name>/<driver-name>_getset.c ~/RIOT/drivers/<driver-name>/<driver-name>_netdev.c ~/RIOT/drivers/<driver-name>/include/<driver-name>_registers.h ~/RIOT/drivers/<driver-name>/include/<driver-name>_params.h ~/RIOT/drivers/<driver-name>/include/<driver-name>_internal.c ~/RIOT/drivers/<driver-name>/include/<driver-name>_netdev.h ~/RIOT/drivers/include/<driver-name>.h
~/RIOT/drivers/Makefile.dep
~/RIOT/drivers/Makefile.include