source: rtems-docs/user/start/bsp-build.rst @ cb4e4e2

5
Last change on this file since cb4e4e2 was fa12cab, checked in by Sebastian Huber <sebastian.huber@…>, on 01/23/19 at 13:26:47

user: Add "Build a Board Support Package (BSP)"

  • Property mode set to 100644
File size: 6.3 KB
Line 
1.. SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. Copyright (C) 2019 embedded brains GmbH
4.. Copyright (C) 2019 Sebastian Huber
5
6.. _QuickStartBSPBuild:
7
8Build a Board Support Package (BSP)
9===================================
10
11You installed the tool suite in your installation prefix, cloned two RTEMS
12repositories and bootstrapped the RTEMS sources in the previous sections.  We
13installed the tool suite in :file:`$HOME/quick-start/rtems/5` and cloned the
14repositories in :file:`$HOME/quick-start/src`.  We also bootstrapped the RTEMS
15sources.
16
17You are now able to build :ref:`Board Support Packages (BSPs) <BSPs>` for all
18architectures where you have an RTEMS tool suite installed.  To build
19applications on top of RTEMS, you have to configure, build and install a BSP
20for your target hardware.  To select a proper BSP for your target hardware
21consult the :ref:`BSPs <BSPs>` chapter.  We select the `erc32` BSP.
22
23We configure, build and install the BSP in four steps.  The first step is to
24create a build directory.  It must be separate from the RTEMS source directory.
25We use :file:`$HOME/quick-start/build/b-erc32`.
26
27.. code-block:: none
28
29    mkdir -p $HOME/quick-start/build/b-erc32
30
31The second step is to configure the BSP.  There are various configuration
32options available.  Some configuration options are BSP-specific.  Prepend the
33RTEMS tool suite binary directory to your ``$PATH`` throughout the remaining
34steps.
35
36.. code-block:: none
37
38    cd $HOME/quick-start/build/b-erc32
39    export PATH=$HOME/quick-start/rtems/5/bin:"$PATH"
40    $HOME/quick-start/src/rtems/configure \
41        --prefix=$HOME/quick-start/rtems/5 \
42        --enable-maintainer-mode \
43        --target=sparc-rtems5 \
44        --enable-rtemsbsp=erc32 \
45        --enable-tests
46
47This command should output something like this (omitted lines are denoted by
48...):
49
50.. code-block:: none
51
52    checking for gmake... gmake
53    checking for RTEMS Version... 5.0.0
54    checking build system type... x86_64-unknown-freebsd12.0
55    checking host system type... x86_64-unknown-freebsd12.0
56    checking target system type... sparc-unknown-rtems5
57    ...
58    config.status: creating Makefile
59
60    target architecture: sparc.
61    available BSPs: erc32.
62    'gmake all' will build the following BSPs: erc32.
63    other BSPs can be built with 'gmake RTEMS_BSP="bsp1 bsp2 ..."'
64
65    config.status: creating Makefile
66
67Building the BSP is the third step.
68
69.. code-block:: none
70
71    cd $HOME/quick-start/build/b-erc32
72    make
73
74This command should output something like this (omitted lines are denoted by
75...).  In this output the base directory :file:`$HOME/quick-start` was replaced
76by ``$BASE``.
77
78.. code-block:: none
79
80    Configuring RTEMS_BSP=erc32
81    checking for gmake... gmake
82    checking build system type... x86_64-unknown-freebsd12.0
83    checking host system type... sparc-unknown-rtems5
84    checking rtems target cpu... sparc
85    checking for a BSD-compatible install... /usr/bin/install -c
86    checking whether build environment is sane... yes
87    checking for sparc-rtems5-strip... sparc-rtems5-strip
88    checking for a thread-safe mkdir -p... $BASE/src/rtems/c/src/../../install-sh -c -d
89    checking for gawk... no
90    checking for mawk... no
91    checking for nawk... nawk
92    checking whether gmake sets $(MAKE)... yes
93    checking whether to enable maintainer-specific portions of Makefiles... yes
94    checking for RTEMS_BSP... erc32
95    checking whether CPU supports libposix... yes
96    configure: setting up make/custom
97    configure: creating make/erc32.cache
98    gmake[3]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32'
99    ...
100    sparc-rtems5-gcc  -mcpu=cypress -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -B./../../lib/libbsp/sparc/erc32 -B$BASE/src/rtems/bsps/sparc/erc32/start -specs bsp_specs -qrtems -L./../../cpukit -L$BASE/src/rtems/bsps/sparc/shared/start -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar -Wl,--gc-sections -o spwkspace.exe spwkspace/spwkspace-init.o ./../../lib/libbsp/sparc/erc32/librtemsbsp.a ./../../cpukit/librtemscpu.a
101    gmake[5]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32/testsuites/sptests'
102    gmake[4]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32/testsuites'
103    gmake[3]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32'
104    gmake[2]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32'
105    gmake[1]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c'
106    gmake[1]: Entering directory '$BASE/build/b-erc32'
107    gmake[1]: Nothing to be done for 'all-am'.
108    gmake[1]: Leaving directory '$BASE/build/b-erc32'
109
110The last step is to install the BSP.
111
112.. code-block:: none
113
114    cd $HOME/quick-start/build/b-erc32
115    make install
116
117This command should output something like this (omitted lines are denoted by
118...).  In this output the base directory :file:`$HOME/quick-start` was replaced
119by ``$BASE``.
120
121.. code-block:: none
122
123    Making install in sparc-rtems5/c
124    gmake[1]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c'
125    Making install in .
126    gmake[2]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c'
127    gmake[3]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c'
128    gmake[3]: Nothing to be done for 'install-exec-am'.
129    gmake[3]: Nothing to be done for 'install-data-am'.
130    gmake[3]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c'
131    gmake[2]: Leaving directory '$BASE/build/b-erc32/sparc-rtems5/c'
132    Making install in erc32
133    gmake[2]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32'
134    gmake[3]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32'
135    Making install-am in .
136    Making install-am in cpukit
137    gmake[4]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32/cpukit'
138    gmake[5]: Entering directory '$BASE/build/b-erc32/sparc-rtems5/c/erc32/cpukit'
139    gmake[5]: Nothing to be done for 'install-exec-am'.
140     $BASE/src/rtems/c/src/../../cpukit/../install-sh -c -d '$BASE/rtems/5/sparc-rtems5/erc32/lib/include'
141    ...
142    $BASE/src/rtems/make/Templates/Makefile.lib '$BASE/rtems/5/share/rtems5/make/Templates'
143     $BASE/src/rtems/./install-sh -c -d '$BASE/rtems/5/make/custom'
144     /usr/bin/install -c -m 644 $BASE/src/rtems/make/custom/default.cfg '$BASE/rtems/5/make/custom'
145    gmake[2]: Leaving directory '$BASE/build/b-erc32'
146    gmake[1]: Leaving directory '$BASE/build/b-erc32'
Note: See TracBrowser for help on using the repository browser.