Best practices for new board / drivers?

I've been working with the samr21-xpro while evaluating RIOT, and at this point I'm sold. It's a great system and I look forward to developing real product on the platform.

But I could use some advice on best practices for project layout as I start to write the board definition for custom hardware. Right now my directory structure looks like this:

./RIOT - simple git clone of the RIOT source that I hope not to modify ./myproject - code I've been using on samr21-xpro, with its own Makefile, main.c, etc.

...what is the recommended way to add a new board definition and some device drivers?

The board definition isn't secret or anything, but it's very custom and unlikely to be of any use to anyone else. The drivers will be for off-the-shelf IC's and may be useful to contribute back.

Many thanks for the great platform to build on!


Hi Brooks,

you can simply overwrite the RIOTBOARD macro in your application’s Makefile with another path where your board definitions reside (e.g. a new path in your current hierarchy ./myboards). If you use a completely new MCU as well, you can also overwrite RIOTCPU for an alternative to $(RIOTBASE)/cpu/.

Hope that helped, Martine

Hi Brooks,