Skip to content

Commit c7a1a20

Browse files
authored
Merge pull request #698 from ckormanyos/example09_08b
Fix #699 via Example09 08b
2 parents 8d5102b + 627dd34 commit c7a1a20

218 files changed

Lines changed: 24009 additions & 9 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/real-time-cpp-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
strategy:
6464
fail-fast: false
6565
matrix:
66-
example: [ chapter12_04a ]
66+
example: [ chapter09_08b, chapter12_04a ]
6767
steps:
6868
- uses: actions/checkout@v4
6969
with:

examples/chapter09_08a/src/mcal/avr/mcal_led_rgb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2017 - 2023.
2+
// Copyright Christopher Kormanyos 2017 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@ auto mcal::led::led_rgb0() -> led_rgb_base&
1616
mcal::reg::portd,
1717
static_cast<std::uint8_t>(UINT8_C(3))>;
1818

19-
using led_rgb0_type = led_rgb_ws2812<led_rgb0_port_pin_type, static_cast<unsigned>(UINT8_C(8))>;
19+
using led_rgb0_type = led_rgb_ws2812<led_rgb0_port_pin_type>;
2020

2121
static led_rgb0_type the_rgb_led;
2222

examples/chapter09_08a/src/mcal/avr/mcal_led_rgb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2017 - 2023.
2+
// Copyright Christopher Kormanyos 2017 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)

examples/chapter09_08a/target/app/make/app_files.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
FILES_CPP = $(PATH_APP)/app/led/app_led \
66
$(PATH_APP)/mcal/mcal \
7-
$(PATH_APP)/mcal/mcal_gcc_cxx_completion \
87
$(PATH_APP)/mcal/$(TGT)/mcal_cpu \
98
$(PATH_APP)/mcal/$(TGT)/mcal_eep \
109
$(PATH_APP)/mcal/$(TGT)/mcal_gpt \
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright Christopher Kormanyos 2007 - 2023.
2+
# Copyright Christopher Kormanyos 2007 - 2025.
33
# Distributed under the Boost Software License,
44
# Version 1.0. (See accompanying file LICENSE_1_0.txt
55
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -9,7 +9,8 @@
99
# File list of the avr files in the project
1010
# ------------------------------------------------------------------------------
1111

12-
FILES_TGT = $(PATH_TGT)/startup/crt0 \
12+
FILES_TGT = $(PATH_APP)/mcal/mcal_gcc_cxx_completion \
13+
$(PATH_TGT)/startup/crt0 \
1314
$(PATH_TGT)/startup/crt0_init_ram \
1415
$(PATH_TGT)/startup/crt1 \
1516
$(PATH_TGT)/startup/int_vect

examples/chapter09_08b/build.bat

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
2+
@rem
3+
@rem Copyright Christopher Kormanyos 2014 - 2025.
4+
@rem Distributed under the Boost Software License,
5+
@rem Version 1.0. (See accompanying file LICENSE_1_0.txt
6+
@rem or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
@rem
8+
9+
10+
@rem
11+
@rem Usage:
12+
@rem build.bat directory_of_gcc_bin prefix_of_gcc-arm-non-eabi
13+
14+
@rem Usage example A,
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter09_08b"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter09_08b\tools\Util\msys64\usr\local\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi
17+
18+
@rem Usage example A1 (use a relative tool path),
19+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter09_08b"
20+
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi
21+
22+
@rem Usage example B,
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter09_08b"
24+
@rem build.bat "C:\Program Files (x86)\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi
25+
26+
27+
@set TOOL_PATH=%1
28+
@set TOOL_PREFIX=%2
29+
30+
@set CFLAGS=-Wall -Wextra -Wpedantic -O2 -finline-functions -finline-limit=64 -mcpu=cortex-m3 -mtune=cortex-m3 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections
31+
@set CPPFLAGS=-std=c++14 -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs
32+
@set CINCLUDES=-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc/mcal/stm32f100 -Isrc
33+
34+
@echo.
35+
@echo.Building with : build.bat
36+
@echo.Using tool path : %TOOL_PATH%
37+
@echo.Using tool prefix : %TOOL_PREFIX%
38+
@echo.Create bin directory : bin\
39+
@if not exist bin mkdir bin
40+
@echo.Clean bin directory : bin\*.o bin\chapter09_08b*.*
41+
@if exist bin\*.o del /Q bin\*.o
42+
@if exist bin\chapter09_08b*.* del /Q bin\chapter09_08b*.*
43+
@echo.
44+
45+
@echo.Compile : app_led.cpp to bin/app_led.o
46+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/led/app_led.cpp -o bin/app_led.o
47+
48+
@echo.Compile : mcal.cpp to bin/mcal.o
49+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/mcal.cpp -o bin/mcal.o
50+
51+
@echo.Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o
52+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/mcal_gcc_cxx_completion.cpp -o bin/mcal_gcc_cxx_completion.o
53+
54+
@echo.Compile : mcal_cpu.cpp to bin/mcal_cpu.o
55+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_cpu.cpp -o bin/mcal_cpu.o
56+
57+
@echo.Compile : mcal_eep.cpp to bin/mcal_eep.o
58+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_eep.cpp -o bin/mcal_eep.o
59+
60+
@echo.Compile : mcal_gpt.cpp to bin/mcal_gpt.o
61+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_gpt.cpp -o bin/mcal_gpt.o
62+
63+
@echo.Compile : mcal_irq.cpp to bin/mcal_irq.o
64+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_irq.cpp -o bin/mcal_irq.o
65+
66+
@echo.Compile : mcal_led.cpp to bin/mcal_led.o
67+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_led.cpp -o bin/mcal_led.o
68+
69+
@echo.Compile : mcal_led_rgb.cpp to bin/mcal_led_rgb.o
70+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_led_rgb.cpp -o bin/mcal_led_rgb.o
71+
72+
@echo.Compile : mcal_led_sys_start_interface.cpp to bin/mcal_led_sys_start_interface.o
73+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_led_sys_start_interface.cpp -o bin/mcal_led_sys_start_interface.o
74+
75+
@echo.Compile : mcal_osc.cpp to bin/mcal_osc.o
76+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_osc.cpp -o bin/mcal_osc.o
77+
78+
@echo.Compile : mcal_port.cpp to bin/mcal_port.o
79+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_port.cpp -o bin/mcal_port.o
80+
81+
@echo.Compile : mcal_pwm.cpp to bin/mcal_pwm.o
82+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_pwm.cpp -o bin/mcal_pwm.o
83+
84+
@echo.Compile : mcal_spi.cpp to bin/mcal_spi.o
85+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_spi.cpp -o bin/mcal_spi.o
86+
87+
@echo.Compile : mcal_wdg.cpp to bin/mcal_wdg.o
88+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_wdg.cpp -o bin/mcal_wdg.o
89+
90+
@echo.Compile : os.cpp to bin/os.o
91+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/os/os.cpp -o bin/os.o
92+
93+
@echo.Compile : sys_idle.cpp to bin/sys_idle.o
94+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/sys/idle/sys_idle.cpp -o bin/sys_idle.o
95+
96+
@echo.Compile : sys_mon.cpp to bin/sys_mon.o
97+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/sys/mon/sys_mon.cpp -o bin/sys_mon.o
98+
99+
@echo.Compile : sys_start.cpp to bin/sys_start.o
100+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/sys/start/sys_start.cpp -o bin/sys_start.o
101+
102+
@echo.Compile : crt0.cpp to bin/crt0.o
103+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/crt0.cpp -o bin/crt0.o
104+
105+
@echo.Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o
106+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
107+
108+
@echo.Compile : crt1.cpp to bin/crt1.o
109+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/crt1.cpp -o bin/crt1.o
110+
111+
@echo.Compile : int_vect.cpp to bin/int_vect.o
112+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/int_vect.cpp -o bin/int_vect.o
113+
114+
@echo.Link : objects to bin/chapter09_08b.elf
115+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x none -nostartfiles %CFLAGS% %CPPFLAGS% %CINCLUDES% -Wl,--gc-sections -Wl,-Ttarget/micros/stm32f100/make/stm32f100.ld,-Map,bin/chapter09_08a.map bin/app_led.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_eep.o bin/mcal_gpt.o bin/mcal_led.o bin/mcal_led_rgb.o bin/mcal_led_sys_start_interface.o bin/mcal_irq.o bin/mcal_osc.o bin/mcal_port.o bin/mcal_pwm.o bin/mcal_spi.o bin/mcal_wdg.o bin/os.o bin/sys_idle.o bin/sys_mon.o bin/sys_start.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter09_08b.elf
116+
117+
@echo.
118+
@echo.Extract : executable hex file : from bin/chapter09_08b.elf
119+
@%TOOL_PATH%\%TOOL_PREFIX%-objcopy -O ihex bin/chapter09_08b.elf bin/chapter09_08b.hex
120+
121+
@echo.Extract : assembly list file : from bin/chapter09_08b.elf
122+
@%TOOL_PATH%\%TOOL_PREFIX%-objdump --disassemble bin/chapter09_08b.elf > bin/chapter09_08b.lss
123+
124+
@echo.Extract : size information : from bin/chapter09_08b.elf
125+
@%TOOL_PATH%\%TOOL_PREFIX%-size -A -t bin/chapter09_08b.elf > bin\chapter09_08b_size.txt
126+
127+
@echo.Extract : name information : from bin/chapter09_08b.elf
128+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter09_08b.elf > bin\chapter09_08b_nm.txt
129+
130+
@echo.Extract : demangled names : from bin/chapter09_08b.elf
131+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter09_08b.elf | %TOOL_PATH%\%TOOL_PREFIX%-c++filt > bin\chapter09_08b_cppfilt.txt
132+
133+
dir .\bin\chapter09_08b.elf .\bin\chapter09_08b.hex
134+
135+
if not exist .\bin\chapter09_08b.elf exit 1
136+
if not exist .\bin\chapter09_08b.hex exit 1
137+
138+
exit 0

examples/chapter09_08b/build.sh

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright Christopher Kormanyos 2014 - 2025.
4+
# Distributed under the Boost Software License,
5+
# Version 1.0. (See accompanying file LICENSE_1_0.txt
6+
# or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
#
8+
9+
10+
#
11+
# Usage:
12+
#
13+
# If command
14+
# /usr/bin/arm-none-eabi-g++
15+
# installed, e.g. via command apt-get install gcc-arm-none-eabi
16+
# then:
17+
# ./build.sh
18+
#
19+
# Otherwise for custom installations
20+
# ./build.sh directory_of_gcc_bin arm-none-eabi
21+
# For example,
22+
# ./build.sh /usr/bin arm-none-eabi
23+
#
24+
# Usage example A (from *nix shell)
25+
# cd /usr/local/real-time-cpp/examples/chapter09_08b
26+
# ./build.sh /usr/local/real-time-cpp/examples/chapter09_08b/tools/Util/msys64/usr/local/gcc-14.2.1-arm-none-eabi/bin arm-none-eabi
27+
28+
# Usage example B (from Win* shell such as in Git for Win*)
29+
# cd C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter09_08b
30+
# ./build.sh C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter09_08b/tools/Util/msys64/usr/local/gcc-14.2.1-arm-none-eabi/bin arm-none-eabi
31+
32+
if [[ $# == 0 ]]; then ## $# is the number of arguments
33+
if [[ -n "$(which avr-g++)" ]]; then ## -n tests if string is not empty
34+
TOOL_PATH="$(dirname $(which avr-g++))"
35+
TOOL_PREFIX=avr
36+
else
37+
echo
38+
echo "Try: apt-get install gcc-avr avr-libc"
39+
echo "Then: ./build.sh"
40+
echo "Otherwise, if you're using a custom avr, use: ./build.sh /directory/to/gcc_avr_bin Prefix"
41+
echo " (such that /directory/to/gcc_avr_bin/Prefix-g++ is the name"
42+
echo " of the c++ compiler)"
43+
exit 1
44+
fi
45+
else
46+
TOOL_PATH="$1"
47+
TOOL_PREFIX="$2"
48+
fi
49+
50+
CFLAGS="-Wall -Wextra -Wpedantic -O2 -finline-functions -finline-limit=64 -mcpu=cortex-m3 -mtune=cortex-m3 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections"
51+
CPPFLAGS="-std=c++14 -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs"
52+
CINCLUDES="-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc/mcal/stm32f100 -Isrc"
53+
54+
echo
55+
echo "Building with : build.sh"
56+
echo "Using tool path : $TOOL_PATH"
57+
echo "Using tool prefix : $TOOL_PREFIX"
58+
echo "Remove bin directory : bin/"
59+
rm -rf bin/
60+
echo "Create bin directory : bin/"
61+
mkdir -p bin
62+
echo
63+
64+
echo "Compile : app_led.cpp to bin/app_led.o"
65+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/led/app_led.cpp -o bin/app_led.o
66+
67+
echo "Compile : mcal.cpp to bin/mcal.o"
68+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal.cpp -o bin/mcal.o
69+
70+
echo "Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o"
71+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal_gcc_cxx_completion.cpp -o bin/mcal_gcc_cxx_completion.o
72+
73+
echo "Compile : mcal_cpu.cpp to bin/mcal_cpu.o"
74+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_cpu.cpp -o bin/mcal_cpu.o
75+
76+
echo "Compile : app_led.cpp to bin/app_led.o"
77+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/led/app_led.cpp -o bin/app_led.o
78+
79+
echo "Compile : mcal.cpp to bin/mcal.o"
80+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal.cpp -o bin/mcal.o
81+
82+
echo "Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o"
83+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal_gcc_cxx_completion.cpp -o bin/mcal_gcc_cxx_completion.o
84+
85+
echo "Compile : mcal_cpu.cpp to bin/mcal_cpu.o"
86+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_cpu.cpp -o bin/mcal_cpu.o
87+
88+
echo "Compile : mcal_eep.cpp to bin/mcal_eep.o"
89+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_eep.cpp -o bin/mcal_eep.o
90+
91+
echo "Compile : mcal_gpt.cpp to bin/mcal_gpt.o"
92+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_gpt.cpp -o bin/mcal_gpt.o
93+
94+
echo "Compile : mcal_irq.cpp to bin/mcal_irq.o"
95+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_irq.cpp -o bin/mcal_irq.o
96+
97+
echo "Compile : mcal_led.cpp to bin/mcal_led.o"
98+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_led.cpp -o bin/mcal_led.o
99+
100+
echo "Compile : mcal_led_rgb.cpp to bin/mcal_led_rgb.o"
101+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_led_rgb.cpp -o bin/mcal_led_rgb.o
102+
103+
echo "Compile : mcal_led_sys_start_interface.cpp to bin/mcal_led_sys_start_interface.o"
104+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_led_sys_start_interface.cpp -o bin/mcal_led_sys_start_interface.o
105+
106+
echo "Compile : mcal_osc.cpp to bin/mcal_osc.o"
107+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_osc.cpp -o bin/mcal_osc.o
108+
109+
echo "Compile : mcal_port.cpp to bin/mcal_port.o"
110+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_port.cpp -o bin/mcal_port.o
111+
112+
echo "Compile : mcal_pwm.cpp to bin/mcal_pwm.o"
113+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_pwm.cpp -o bin/mcal_pwm.o
114+
115+
echo "Compile : mcal_spi.cpp to bin/mcal_spi.o"
116+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_spi.cpp -o bin/mcal_spi.o
117+
118+
echo "Compile : mcal_wdg.cpp to bin/mcal_wdg.o"
119+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/stm32f100/mcal_wdg.cpp -o bin/mcal_wdg.o
120+
121+
echo "Compile : os.cpp to bin/os.o"
122+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/os/os.cpp -o bin/os.o
123+
124+
echo "Compile : sys_idle.cpp to bin/sys_idle.o"
125+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/idle/sys_idle.cpp -o bin/sys_idle.o
126+
127+
echo "Compile : sys_mon.cpp to bin/sys_mon.o"
128+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/mon/sys_mon.cpp -o bin/sys_mon.o
129+
130+
echo "Compile : sys_start.cpp to bin/sys_start.o"
131+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/start/sys_start.cpp -o bin/sys_start.o
132+
133+
echo "Compile : crt0.cpp to bin/crt0.o"
134+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/stm32f100/startup/crt0.cpp -o bin/crt0.o
135+
136+
echo "Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o"
137+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/stm32f100/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
138+
139+
echo "Compile : crt1.cpp to bin/crt1.o"
140+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/stm32f100/startup/crt1.cpp -o bin/crt1.o
141+
142+
echo "Compile : int_vect.cpp to bin/int_vect.o"
143+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/stm32f100/startup/int_vect.cpp -o bin/int_vect.o
144+
145+
echo "Link : objects to bin/chapter09_08b.elf"
146+
$TOOL_PATH/$TOOL_PREFIX-g++ -x none -nostartfiles $CFLAGS $CPPFLAGS $CINCLUDES -Wl,--gc-sections -Wl,-Ttarget/micros/stm32f100/make/stm32f100.ld,-Map,bin/chapter09_08b.map bin/app_led.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_eep.o bin/mcal_gpt.o bin/mcal_led.o bin/mcal_led_rgb.o bin/mcal_led_sys_start_interface.o bin/mcal_irq.o bin/mcal_osc.o bin/mcal_port.o bin/mcal_pwm.o bin/mcal_spi.o bin/mcal_wdg.o bin/os.o bin/sys_idle.o bin/sys_mon.o bin/sys_start.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter09_08b.elf
147+
148+
echo
149+
echo "Extract : executable hex file : from bin/chapter09_08b.elf"
150+
$TOOL_PATH/$TOOL_PREFIX-objcopy -O ihex bin/chapter09_08b.elf bin/chapter09_08b.hex
151+
152+
echo "Extract : assembly list file : from bin/chapter09_08b.elf"
153+
$TOOL_PATH/$TOOL_PREFIX-objdump --disassemble bin/chapter09_08b.elf > bin/chapter09_08b.lss
154+
155+
echo "Extract : size information : from bin/chapter09_08b.elf"
156+
$TOOL_PATH/$TOOL_PREFIX-size -A -t bin/chapter09_08b.elf > bin/chapter09_08b_size.txt
157+
158+
echo "Extract : name information : from bin/chapter09_08b.elf"
159+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter09_08b.elf > bin/chapter09_08b_nm.txt
160+
161+
echo "Extract : demangled names : from bin/chapter09_08b.elf"
162+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter09_08b.elf | $TOOL_PATH/$TOOL_PREFIX-c++filt > bin/chapter09_08b_cppfilt.txt

0 commit comments

Comments
 (0)