Chibios second steps

Posted at 2015-11-23.

Earlier (at Tarlab), I set up my laptop to build and flash ChibiOS on a Maple mini board. I also cloned the 3.0.x stable branch from github and tested a new command.

Diversion

So I thought I'd look into creating a thread in ChibiOS.

But, distractions being distractions and circumstances being I don't have a Maple board plugged in, I started to wonder if there are any simulator targets these days and if any run on Windows. I found GNU ARM Eclipse QEMU which looks rather interesting and even claims to emulate a Maple! Tiva support might also be in the works. M4 FP instructions apparently don't exist.

Installing Qemu

I picked up gnuarmeclipse-qemu-win64-2.4.50-201510290935-dev-setup.exe to try. My Eclipse (Mars) did indeed detect it like instructions suggest.

I went through some of the configurations suggested and set up packs perspective.

It's crazy how many things you have to click through to make something work in Eclipse, but it's probably getting better with time. Of course tool setup mostly needs to be done once and then you can keep using it.

Testing blinky

simulator screenshot
Simulating blinky

The first tutorial suggest building blinky project for gae. I set up a semihosting F4 project as suggested. It builds fine. Installing a pack takes ages. This suggest that the pack, without any information on what it contains or what the licenses involved are, is also ginormous.

Running (as per instructions) pops up an image of the discovery board and seems to execute a binary counter on some LEDs. Consoles have convincing output including the trace_printf call output. These seem to be a part of some Trace system. I didn't examine closer. I wonder if you can get UART or even USB ACM output out somehow.

Looks quite good, really. One interesting thing to not is that the blinky main.cpp contains a copyright clause and no license terms whatsoever, so it's not usable as a template. An included HAL file has copyright and disclaimer from ST and seems to be redistributable with attribution.

I can also run Debug with a fairly default configuration and end up in an automatic breakpoint at main() as usual. Stepping ahead puts out trace_printf output as expected.

Back to the Maple

Looks like there's no mention of Maple in the packs. STM32F1 pack is installable, though. I also spot LPC800 under NXP and Tiva under TI in boards.

I can also seemingly run the ChibiOS elf with STM32F103RB chip, but how will I get any IO? Maybe only through the debugger. I haven't looked at running that at all. The aforementioned guide just runs the code (like a regression test).

So, folowing debug session instructions I set up a debug configuration. I disabled the bootloader in the Makefile. Using ? as board name reveals that Maple should work. A picture of the board shows up. This turns out to be a Maple board, not a Maple Mini.

Starting debug, I seem to keep ending up at 0x00 and SIGTRAP. So, something in the debug isn't settling in right. Maybe I'll look at that someday or try out some more raw firmware instead if I want simulation. I also have a board with JTAG if I wanted to try ICE.

So, no real progress on the ChibiOS front after all, but an interesting diversion.

Links