Following on from my previous post about wanting to experiment with 6LoWPAN and Contiki, I suppose I’d better do something. First things first. I needed to download Contiki and get it building. I’ve got a few options.
A Linux VM
The official guide pointed me towards using a pre-configured “Instant Contiki” Ubuntu VM and that certainly works. I needed to install and setup VMWare but that wasn’t too bad. It’s probably time I played around with Linux a bit more, so I also installed Linux Mint (easier for newbies) in a VM too.
There was also a guide on Sun May Sky about using Cygwin on Windows. I’m sure this works as described and I was about to give it a try, but then I though “Cygwin? Isn’t that a little outdated for Windows 10?”
Bash on Ubuntu on Windows
There is a “proper” Ubuntu bash shell as (a hidden) part of the latest Windows 10 build so that seemed like a neater solution. In theory, this should be closer to a normal Linux shell that Cygwin. Time to give it a try and write my own guide. Spoiler – it works!
Firstly, enable the hidden bash shell. The Microsoft guide is here so you may want to open that for the details. Basically all you need to do is:
- enable Developer Mode (you’ve done that already, right?)
- check the newly revealed “Windows Subsystem for Linux (beta)” windows component.
- Use the Bash on Ubuntu on Windows app
The only thing worth mentioning is that your C drive will appear as /mnt/c rather than Cygwin’s /cygdrive/c.
YaKai Chen’s Cygwin guide mentioned installing the ARM GNU Compiler toolchain and adding the installation folder to the path. The default Windows installation path with spaces and (x86) is awkward to use in Linux and it turns out it isn’t even necessary.
I went to build a Contiki component with a make command. See one of the many guides for a specific build.
You’ll notice the make failed with arm-none-eabi-gcc not found, so I tried just entering arm-none-eabi-gcc. A very helpful prompt told me that apt-get install gcc-arm-none-eabi might solve my woes. And it did.
Time to try that make again… OK, this time srec_cat was the missing culprit, but just typing srec_cat told me what needed to be installed. Simply apt-get install srecord and I was ready for attempt #3… and success.
That seemed easy! Don’t tell anyone, but I might get to like this new Bash shell. Now to get something meaningful working…
UPDATE: Compiling the hello-world example failed with cc not found, but apt-get install gcc sorted that one. There may be more, but I sense a pattern here.