Posts

Showing posts from March, 2015

Machine readable

One of the error prone parts of working with the various STM32 micro controllers is that you must configure a peripheral, and in addition, configure specific pins to express that peripheral. This isn't exactly an end product quality issue: it's just a time waster when playing with an evaluation board. If you get it wrong, it doesn't complain: it just doesn't work. Examples often don't explain the relationship between pin settings and peripherals, so you end up endlessly returning to the datasheet, and a table called the alternate function mapping. This doesn't seem to be published in a machine readable format. I thought I would have a quick go at extracting it. I tried tabula extractor , but the results weren't that good. Looking a little further down the list I found pdf-table-extract which the author wrote to extract data from ST Micro datasheets! I haven't tried it yet.

Picobit with serial console

I added some I2C primitives, and to do this I wrote a few helpers to access vectors from Chibios. Then I though: I need a simple way to test this, so I added support for Serial over USB. This didn't work, and when the micro-controller crashed. it took the Linux USB driver with it, and I had to reboot. That precludes using the debugger - since it connects via USB too. So now I have a double defence: The micro-controller dev board is connected to the raspberry pi via USB, and also via serial: the pi has a 3.3V serial port which is perfect for this. You can read some instructions  here . You don't have to reboot though: just do $ sudo init q instead to get init to reload it's configuration. If I have to reboot the pi to get USB access back that will be OK, but using the serial port makes that unlikely anyway. I still haven't used the debugger. My problem turned out to be a cut and paste error: Picobit passes arguments to primitives in 4 global variables. This mak