C/C++/assembler built environment for micro-controllers
file: bmptk/README.md
Copyright (c) 2012 .. 2021
Bmptk itself is distributed under the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
This is the bmptk (Bare Metal Programming Tool Kit) main directory.
Bmptk is a minimalist make-based development environment for
small micro-controllers using GCC C, C++, or assembler on
Windows and Linux.
This directory contains :
files
license.txt : license (refers to the boost license)
license_1_0.txt : boost license
For each target, bmptk provides
The heap is by default disabled: using heap functions will generate an
exaplanatory linker error.
For C++, global constructor calls (ctors) are also disabled, and
will generate an exaplanatory linker error.
By default, exceptions and RTTI are disabled by compiler options.
Most tools (toolchain, downloaders) are not part of bmptk
and must be installed separately.
Installation instructions for Ubuntu can be found at
https://www.github.com/wovo/ubuntu-toolchains
Actively supported targets chips and boards are:
The development environment uses make and makescipt(s) to do the work.
The main makescipt is Makescript.inc.
If it exists it includes Makescript.custom, or else Makescript.local.
The makefile for a project must set a few variables, and then include
(directly, or via a chain of includes) the bmptk/Makescript.inc.
As a minimum, a project makefile must set the target the project has
to be built for.
TARGET := arduino_uno
Valid targets are either bare chips:
or boards:
Additionally, the target native can be used to produce a native executable.
The name of the project can be set.
If not set, the default is main.
The project name determines the base name of the various
files tat are build like .exe, .bin or .hex.
PROJECT := main
A project contains at least on source file.
The base name of this file must match the PROJECT name,
and its extension must be .asm, .c, or .cpp.
Additional source files can be specified by setting SOURCES:
SOURCES := interface.cpp
The header files can be specified by setting HEADERS:
Additional source files can be specified by setting SOURCES:
HEADERS := interface.hpp
The bmptk makefile uses a very simple rebuild principle:
it assumes all SOURCES depend on all HEADERS.
This is conservative, but it ensures that the sources that
must be compiled are (provided that the HEADERS are set correctly).
By default, bmptk assumes that all sources and headers are in
the project directory (where the make command is run).
Additional locations where the sources and headers can reside
can be specified by setting SEARCH:
SOURCES := local_library ../shared_library
By default, the files that are needed will be produced.
You can specify extra results to be produced,
like .lst files for a source file, or the .lss file
for the project.
RESULTS := main.lst main.lss
Some programmers use a serial-over-USB port for downloading.
On linux, the serial port to use can generally be deduced
automatically.
On windows, or when you must specify the serial port, you
can set the SERIAL_PORT:
SERIAL_PORT := COM4
For most targets, after the the project has been build,
downloaded and started, a terminal window
is started with a serial connection to the target.
This connection uses the SERIAL_PORT at the SERIAL_BAUDRATE,
which (if not set) defaults to 38400 baud.
You can prevent the terminal window from being started by
setting RUN_TERMINAL to empty:
RUN_TERMINAL :=
At the end, a project makefile must set BMPTK to
the location of the bmptk directory, and include
the bmptk/Makefile.inc file.
BMPTK := ~/bmptk
include $(BMPTK)/Makefile.inc