> now their hardware abstraction layer, the HAL library, leaves quite a bit to be desired, but it's nice to get a starting point for newbies.
libopencm3 is a very good alternative with a much better license if you're looking to open source your work [0]. They give you some nice examples [1], and a project template [2]. The documentation is okay, but like most doxygen projects, I find it easier to just read the headers myself.
[0] http://libopencm3.org [1] https://github.com/libopencm3/libopencm3-examples.git [2] https://github.com/libopencm3/libopencm3-template