Skip to content

"libemb" is a collection of libraries which try to make things needed in many STM32 (ARM-Cortex-M3) or MSP430 (MSP430G2553) based projects more convenient. It includes an API for the Nordic nRF24l01+ modules.

License

Notifications You must be signed in to change notification settings

wendlers/libemb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libemb
(c) 2011-2012 Stefan Wendler
[email protected]
http://gpio.kaltpost.de/

C-library for ARM-Cortex-M3 based STM32 MCUs and MSP430G2553 MCUs
=================================================================


Introduction
------------

"libemb" is a collection of libraries which try to make things needed in many MCU based projects more convinient. It includes helbers for console output, USART usage, as well es drivers for specific hardware. STM32 version of "libemb" relays on "libopencm3", MSP430 version uses the headers that come with msp430-gcc. 

Currently "libemb" contains the following helper libraries:

* libserial

	- configure default USART to be used as UART for serial communication
	- read-/write to the default UART blocking and non-blocking

* libconio

	- console IO, currently done on the UART configured by "libserial"
	- methods for printing strings and numbers
	- includes tiny version of "printf"

* libshell

	- provide environment needed to build interactive (remote-) shells
	- define commands with descriptions and callback handlers
	- does the argument parsing for you

* libi2c

	- i2c slave 
	- easy I2C command handling (register read/write) from master

And the following driver libraries:

* libnrf24l01

	- API for the Nordic nRF24l01+ wireless module
	- initialization of the SPI bus to communicate with the module
	- helper functions to configure the nRF24l01 into one of its modes: 
		- SB, 
		- ESB
		- ESB with payload
	- helper functions to read/modify the conf-registers of the module


Supported Targets
-----------------

Currently the following ARM-Cortex-M3 targets are supported:

* STM32F100 (tested on the STM32VL Discovery)
* STM32F103 (tested on the IFLAT-32)

And the following MSP430 MCUs are supported:

* MSP430G2553 (tested with TI Launchpad)

MCU/hardware specific stuff is clearly seperated from the rest, so porting to a different target (or base library) should not be a big deal.


Compilation
------------

STM32: "libemb" depends on "libopencm3". The compilation steps described here assume, that you installed "libopencm3" allong with the "summon-arm-toolchain", located in its default location "~/sat". 

MSP430: the project is written for msp430-gcc on Linux (I used v4.5.3 which is available as package on ubuntu). For flashing the "mspdebug" tool was used (also from the Ubuntu package). It is assumed, you installed a working msp430-gcc on your system.


* Compile Libraries for STM32 *

To compile the libraries, change to the toplevel directory "libemb" and issue:

make

* Compile LIbraries for MSP430 *

TARCH=MSP430 make

This will produce the various libraries in the "lib" directory of each of the subprojects.

You could copy the libraries to a location you like, along with the header files under each "src/include" directory of the subprojects, or use the install target as described in the next section.


Installation
------------

* Install for STM32 *

To instal the libraries and headers to the default location which is "$HOME/sat/arm-none-eabi", type the following:

make install

The libraries then go to "$HOME/sat/arm-none-eabi/lib", and the headers go to "$HOME/sat/arm-none-eabi/include/libemb/<subproject>/".


* Install for MSP430 *

To instal the libraries and headers to the default location which is "$HOME/msp430", type the following:

TARCH=MSP430 make install

The libraries then go to "$HOME/msp430/lib", and the headers go to "$HOME/msp430/include/libemb/<subproject>/".


If yout don't like that location specify a different one by setting "INSTDIR":

INSTDIR=<your-location> make install


Compilation of the Tests
------------------------

Within the directory "test", various test firmwares are located (see the README that comes with each test for more information). While compiling the tests, make sure, to do this for the proper target MCU. Currently the targets STM32F103 (which is the default target) and STM32F100 and MSP430 are supported.

To compile the tests for the STM32F100:

TARCH=STM32_100 make test

And to compile the tests for the STM32F103:

TARCH=STM32_103 make test

And for the MSP430G2553:

TARCH=MSP430 make test


To flash a test firmware to your device, you could use the "flash-target" make target which is available in the makefile of each test (not in the toplevel makefile). For more details see the README provided for each test. 


Doxygen Docs
------------

If you installed doxygen on your system, you could generate the HTML-based API documentation by calling:

make gen-docs

This will create the API documentation unter "doc/gen/html" within each subproject.


Tailor to a Different Environment
---------------------------------

If you use a different compiler etc., you could change the settings in the "common_lib.mk" file which is located in the top-level directory of "libemb". To tailor the settings for the test firmwares, edit "common.mk" in the same directory.  


Usage
-----

For usage examples etc. visit the project homepage at: http://gpio.kaltpost.de/

About

"libemb" is a collection of libraries which try to make things needed in many STM32 (ARM-Cortex-M3) or MSP430 (MSP430G2553) based projects more convenient. It includes an API for the Nordic nRF24l01+ modules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages