Chibios first steps

Posted at 2015-11-19.

Earlier (at Tarlab), I set up my laptop to build and flash ChibiOS on a Maple mini board. So, what now?

I naturally read, decide to ignore the style guide for my own files for now, and look at main.c.

I add a Hello World procedure and add it to the list of commands, build and run dfu-util. Putty connection says the code works!

ch> help
Commands: help exit info systime mem threads test write hello
ch> hello

Annoyingly, the serial port comes and goes on each reset and Putty loses the connection, so it is a bit tedious to test like this. I should try to find something more handy.

Also, I think I might want this all in a repository. ChibiOS has a github repo (mirror) so this looks like a tempting path to tread now.

I could run plain git or have a further diversion into EGit and Mylyn.

So I set up EGit and try to clone myself a repo. I couldn't convince Mylyn to do it after a rough hour. I cloned the 3.0.x stable branch git and started by importing existing maple demo project. I should be getting a newer version here as well. Click build and hey, it built! Hit perpetual bootloader and run dfu-util from the tool button and reset... (For some reason the port is now COM4.)

ch> info
Kernel:       3.0.3
Compiler:     GCC 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288]
Architecture: ARMv7-M
Core Variant: Cortex-M3
Port Info:    Advanced kernel mode
Platform:     STM32F10x Performance Line Medium Density
Board:        LeafLabs Maple Mini
Build time:   Nov 19 2015 - 20:57:08

I redid the hello code.

ch> help
Commands: help exit info systime mem threads test write hello
ch> hello

After poking around for a good while, it seems I can enter a "Git staging view" and see nice diffs for current changes, enter a commit message, and commit + push straight away.


Well, actually a lot of trouble that would have Just Worked using commandline git and a simple editor, but this is supposed to be educational and character-forming!

A lot of simple things could be plugged in here just as commands. More interesting model would naturally be creating some task(s) that may do things and possibly add testing/control/instrumentation commands to main only. There should be a way to pass messages to your tasks. That will have to wait for another session.