## Getting started, final episode

The concluding articles of the Getting Started series will start tomorrow, and as you’ll see, setting up an ARM cross-compile toolchain is trivial on Ubuntu Linux.

But I am struggling with the Windows side of things. Lots of little details, ready to trip you up when you start to work your way through :(

I can and do test on Windows, but only on 8.1, and frankly - now that I’ve gone through the whole process - I don’t fully recall all the exact details of what I did…

If you’re on the brave side of the tinkerer’s spectrum and interested in setting up this Linux-under-Windows thing yourself, I’d appreciate any comments, suggestions, notes, and other feedback you’d like to give. There’s probably a lot to work through, and there might even be considerable variation for different systems. Any step we can simplify or even rip out again will be helpful.

(I still think this is useful path to set out, since after all that initial work, we can end up with a fairly similar and consistent setup)

### Replies (13)

#### RE: Getting started, final episode - Added by jcwover 4 years ago

FWIW, here’s the article which didn’t get finished in time last week - about setting up a Linux VM under Windows:

http://jeelabs.org/book/1447c2/

#### RE: Getting started, final episode - Added by Marsover 4 years ago

Just a tiny error in the shop: LCP810 instead of LPC810 ;-)

#### RE: Getting started, final episode - Added by JohnOover 4 years ago

jcw wrote:
> FWIW, here’s the article which didn’t get finished in time last week - about setting up a Linux VM under Windows:
>
> http://jeelabs.org/book/1447c2/

Worked fine for me on Win7x64.

Perhaps add a section on using screen or something better to access the FTDI, ideally not using sudo, ownership issues I guess.
Possibly a section on setting detailing the “public/private key pair for logging in”.

#### RE: Getting started, final episode - Added by martynjover 4 years ago

@Mars,
Thanks, fixed.  Overexcited fingers I guess ;-)

#### RE: Getting started, final episode - Added by JohnOover 4 years ago

Umh, maybe something is down somewhere:

Err http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-libc-dev amd64 3.13.0-39.66
Err http://security.ubuntu.com/ubuntu/ trusty-security/main linux-libc-dev amd64 3.13.0-39.66

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

sudo apt-get update


Seems to have fixed it.

#### RE: Getting started, final episode - Added by jcwover 4 years ago

> Worked fine for me on Win7x64.

@JohnO - thanks for trying it out. Glad to hear it worked!

Yes, screen, minicom, or picocom are all suitable for basic serial port access, but there’s another option which also works really well: if you add the “-term” option to lpc21isp when uploading, it’ll enter serial mode after the upload. Very very convenient. Then press escape to close the connection. This is probably worth a separate post, thanks.

Tons of tools to get into, but they take more effort to learn. I really like “tmux”, in combination with Putty full-screen. Lets you segment the screen into different panes, and thats just scratching the surface. A very powerful feature of tmux is that you can simulate/automate sending keys (anything) from the command line, so it’s not hard to set up things so the upload happens, terminal mode is entered, and some keys are typed to set up things on the µC side of things. Great for development and testing.

As for the public/private key stuff in Putty: I haven’t yet figured out how to generate an RSA key pair on Windows / in Putty. Yes, it’d be good to have that documented too.

#### RE: Getting started, final episode - Added by gbloiceover 4 years ago

jcw wrote:

> As for the public/private key stuff in Putty: I haven’t yet figured out how to generate an RSA key pair on Windows / in Putty. Yes, it’d be good to have that documented too.

See the PuTTY docs Section 8 for key generation (http://the.earth.li/\~sgtatham/putty/0.63/htmldoc/Chapter8.html\#pubkey).

Once you have the public key in “Public key for pasting into authorized_keys file” format, it can be transferred to the linux system using pscp, e.g.

pscp path\to\ public\key user@server:.ssh/key.pub


and then on the linux system copy the file into authorized_keys:

S$cat ~/.ssh/key.pub >> ~/.ssh/authorized_keys S$ rm ~/.ssh/key.pub
S$chmod 600 ~/.ssh/authorized_keys S$ chmod 700 ~/.ssh


#### RE: Getting started, final episode - Added by gbloiceover 4 years ago

jcw wrote:

> But I am struggling with the Windows side of things. Lots of little details, ready to trip you up when you start to work your way through :(
>

The cross compiler is easy, the GNU Tools for ARM Embedded Processors project provides a Windows installer, just make sure to check the option to add the install onto PATH.

GNU Make is also easy, from the GnuWin32 project port of Make, although slightly trickier to install as you have to unzip all the files (and dependencies) in the right place.

Both the above also have Chocolatey installers GCC-ARM-Embeded and Make which make installing (and keeping up to date) trivial.

What are you aiming for with the dev package, i.e. what are the base requirements likely to be required for the Makefiles? If the Makefiles have a lot of linuxism’s, e.g. copious use of cat, cp, rm etc. then that does make life a bit difficult and will require the equivalents from somewhere. These could possible be handled with other GnuWin32 packages (again via Chocolatey: Gnuwin), or require the more complicated solutions of MSys or Cygwin to give a *nix emulation layer.

A final thought, although it does provide an extra layer of indirection is to use CMake, that takes a CMakeLists.txt file describing the project and then spits out the required platform specific Makefile. CMake has platform independent copy, delete etc. but I haven’t used it for ARM stuff though.

#### RE: Getting started, final episode - Added by jcwover 4 years ago

> See the PuTTY docs Section 8 for key generation

Thank you, will do.

As for getting a full-blown embedded development going on Windows, instead of the Linux-VM-under-Windows approach I’ve been describing - I’m going to have to pass the baton to someone else for that. There are some risks down the road, as I will probably be using Linux more and more. Either in a VM, or on a dedicated embedded platform. So yes, Linuxism’s are bound to creep in all the time. Where they can be avoided, I’ll be happy to do so. I’m not trying to make life on Windows hard.

A second, related, reason for suggesting the use of Linux for development, is that I would like to work towards a Linux system as the central hub of home monitoring, automation, and more. So there too, Linux is going to become a more important ingredient of the stuff coming from JeeLabs over time. It’s simply the most practical way to go for a low-power (≤7W) always-on system, I think. And with millions of RasPi’s out there, it’s well supported and easy to get your feet wet, I would think.

I understand that you can stay in Windows and do just about anything, and that there are probably a lot of resources out there for doing so. But I’m going to have to pass to avoid spreading myself too thin.

(I’ll continue to include embedded development on Mac OS X as much as possible, because that’s what I have here anyway, and I’m quite familiar with it)

Having said that, if someone wants to collect notes on Windows, you’re welcome to do so on the Café wiki on this site, or elsewhere, or blog about it - and I’ll be more than happy to link to it and mention it.

Thanks for the tip on CMake. I’ve come across it a few time - would be a good opportunity to check it out for embedded development.

#### RE: Getting started, final episode - Added by jcwover 4 years ago

Hm, I’m such a Windows noob by now…

Where to find puttygen? I found a Linux package “putty-tools” which includes it, but that’s not what you were referring to, I think?

There’s WinSCP, but do I really need all that just to generate a key pair?

#### RE: Getting started, final episode - Added by gbloiceover 4 years ago

PuTTYGen is part of the (windows) PuTTY suite, you can either download each component, or grab the all-in-one installer. See the PuTTY Download page. Or use Chocolatey

cinst putty


:-)

#### RE: Getting started, final episode - Added by gbloiceover 4 years ago

jcw wrote:
> > See the PuTTY docs Section 8 for key generation
>
> Thank you, will do.
>
> As for getting a full-blown embedded development going on Windows, instead of the Linux-VM-under-Windows approach I’ve been describing - I’m going to have to pass the baton to someone else for that. There are some risks down the road, as I will probably be using Linux more and more. Either in a VM, or on a dedicated embedded platform. So yes, Linuxism’s are bound to creep in all the time. Where they can be avoided, I’ll be happy to do so. I’m not trying to make life on Windows hard.
>
> A second, related, reason for suggesting the use of Linux for development, is that I would like to work towards a Linux system as the central hub of home monitoring, automation, and more. So there too, Linux is going to become a more important ingredient of the stuff coming from JeeLabs over time. It’s simply the most practical way to go for a low-power (≤7W) always-on system, I think. And with millions of RasPi’s out there, it’s well supported and easy to get your feet wet, I would think.
>
> I understand that you can stay in Windows and do just about anything, and that there are probably a lot of resources out there for doing so. But I’m going to have to pass to avoid spreading myself too thin.
>
> (I’ll continue to include embedded development on Mac OS X as much as possible, because that’s what I have here anyway, and I’m quite familiar with it)
>
> Having said that, if someone wants to collect notes on Windows, you’re welcome to do so on the Café wiki on this site, or elsewhere, or blog about it - and I’ll be more than happy to link to it and mention it.
>
> Thanks for the tip on CMake. I’ve come across it a few time - would be a good opportunity to check it out for embedded development.

Understood, just trying to think of ways to lower the entry barrier for those whose only experience is Windows.

A RasPi is a big jump over an LPC810 though, and it does support a full dev env. (slow as it is). For a basic ARM intro though. the fewer new concepts folks have to work though the better, but I do understand the difficulties with trying to keep everything cross-platform.

Did you know about the pre-configured VB VM’s, e.g. from here: http://virtualboxes.org/images/ubuntu-server/?

Someone could even create the Jeelabs VM with all the parts pre-installed :-)

#### RE: Getting started, final episode - Added by jcwover 4 years ago

It’s definitely a challenge to reduce the number of hoops one has to jump through. I needed over a dozen articles to get no more than just the bare basics down, and the whole process feels tricky enough that it’s bound to scare off a number of people. Even it it works well now, it might fail tomorrow when “something has changed”.

Thanks for the puttygen tip. I downloaded it separately, for now. Worked great, after some head-scratching :)

Chocolatey looks like a useful tool (similar to Homebrew on Mac).

There are more options, such as Cloud9 (http://c9.io), which supports shell access. I installed the arm toolchain in a workspace and was able to generate a binary in no time. No USB uploads, evidently - though one could perhaps use some https-based download tool to get the binary back and into an attached device.

There’s MBED, though its runtime currently has a bit too much overhead to use on an LPC810.

I explored preparing OS images in the “Dive Into JeeNodes” series a while ago (in that case a RasPi image). It worked, but it was tedious for me to keep up to date. Nowadays, there’s also Docker, so maybe the time is approaching to revisit this and try maintaining an image for quick VBox setup. It wouldn’t solve the Putty side of things, but a pre-configured VBox would make that part effortless.

If we - anyone reading this - were to somehow join forces to make a good long-term setup happen, I’d be delighted and willing to help out where I can.

(1-13/13)