Skip to content

Commit 6c636f9

Browse files
authored
Merge pull request #693 from ckormanyos/example12_04a
Example12 04a
2 parents 297110f + 05e976a commit 6c636f9

202 files changed

Lines changed: 23835 additions & 6 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: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##############################################################################
2-
# Copyright Christopher Kormanyos 2023 - 2024.
2+
# Copyright Christopher Kormanyos 2023 - 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)
@@ -55,6 +55,29 @@ jobs:
5555
./build.sh /usr/bin avr
5656
ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.map ./bin/${{ matrix.example }}.hex
5757
working-directory: ./examples/
58+
target-bl602_sifive_e24_riscv-examples:
59+
runs-on: ubuntu-latest
60+
defaults:
61+
run:
62+
shell: bash
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
example: [ chapter12_04a ]
67+
steps:
68+
- uses: actions/checkout@v4
69+
with:
70+
fetch-depth: '0'
71+
- name: update-tools
72+
run: |
73+
wget --no-check-certificate https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v15.2.0-1/xpack-riscv-none-elf-gcc-15.2.0-1-linux-x64.tar.gz
74+
tar -xzf xpack-riscv-none-elf-gcc-15.2.0-1-linux-x64.tar.gz -C ${{ runner.workspace }}
75+
- name: target-bl602_sifive_e24_riscv-examples
76+
run: |
77+
cd ${{ matrix.example }}
78+
./build.sh ${{ runner.workspace }}/xpack-riscv-none-elf-gcc-15.2.0-1/bin riscv-none-elf
79+
ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.map ./bin/${{ matrix.example }}.hex
80+
working-directory: ./examples/
5881
target-bcm2835_raspi_b-example10_09:
5982
runs-on: ubuntu-latest
6083
defaults:

examples/chapter12_04/chapter12_04.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@
389389
<ClInclude Include="src\util\utility\util_utype_helper.h" />
390390
</ItemGroup>
391391
<ItemGroup>
392+
<None Include="build.bat" />
393+
<None Include="build.sh" />
392394
<None Include="src\util\STL\algorithm">
393395
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
394396
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>

examples/chapter12_04/chapter12_04.vcxproj.filters

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,5 +523,7 @@
523523
<None Include="src\util\STL\any">
524524
<Filter>src\util\STL</Filter>
525525
</None>
526+
<None Include="build.bat" />
527+
<None Include="build.sh" />
526528
</ItemGroup>
527529
</Project>

examples/chapter12_04/target.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ProjectGuid>{30CE370B-40F3-4BCD-8986-64AAFF8971BD}</ProjectGuid>
1515
<RootNamespace>Target</RootNamespace>
1616
<Keyword>Win32Proj</Keyword>
17-
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
17+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1818
</PropertyGroup>
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='target avr|Win32'" Label="Configuration">
@@ -41,7 +41,7 @@
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='target avr|x64'" Label="Configuration">
4343
<ConfigurationType>Makefile</ConfigurationType>
44-
<PlatformToolset>v141</PlatformToolset>
44+
<PlatformToolset>v143</PlatformToolset>
4545
</PropertyGroup>
4646
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Target AVR32|Win32'">
4747
<ConfigurationType>Makefile</ConfigurationType>

examples/chapter12_04a/build.bat

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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_avr_gcc
13+
14+
@rem Usage example A,
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter12_04a"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter12_04a\tools\Util\msys64\usr\local\gcc-15.2.0-riscv-none-elf\bin" riscv-none-elf
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\chapter12_04a"
20+
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-15.2.0-riscv-none-elf\bin" riscv-none-elf
21+
22+
@rem Usage example B,
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter12_04a"
24+
@rem build.bat "C:\Program Files (x86)\gcc-15.2.0-riscv-none-elf\bin" riscv-none-elf
25+
26+
27+
@set TOOL_PATH=%1
28+
@set TOOL_PREFIX=%2
29+
30+
@set CFLAGS=-Wall -Wextra -Wpedantic -O2 -ffast-math -mcpu=sifive-e24 -mabi=ilp32 -msmall-data-limit=32 -falign-functions=4 -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/bl602_sifive_e24_riscv -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\chapter12_04a*.*
41+
@if exist bin\*.o del /Q bin\*.o
42+
@if exist bin\chapter12_04a*.* del /Q bin\chapter12_04a*.*
43+
@echo.
44+
45+
@echo.Compile : app_benchmark.cpp to bin/app_benchmark.o
46+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/benchmark/app_benchmark.cpp -o bin/app_benchmark.o
47+
48+
@echo.Compile : app_led.cpp to bin/app_led.o
49+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/led/app_led.cpp -o bin/app_led.o
50+
51+
@echo.Compile : cmath_impl_gamma.cpp to bin/cmath_impl_gamma.o
52+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/util/STL/impl/cmath_impl_gamma.cpp -o bin/cmath_impl_gamma.o
53+
54+
@echo.Compile : mcal.cpp to bin/mcal.o
55+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/mcal.cpp -o bin/mcal.o
56+
57+
@echo.Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o
58+
@%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
59+
60+
@echo.Compile : mcal_cpu.cpp to bin/mcal_cpu.o
61+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/bl602_sifive_e24_riscv/mcal_cpu.cpp -o bin/mcal_cpu.o
62+
63+
@echo.Compile : mcal_eep.cpp to bin/mcal_eep.o
64+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/bl602_sifive_e24_riscv/mcal_eep.cpp -o bin/mcal_eep.o
65+
66+
@echo.Compile : mcal_gpt.cpp to bin/mcal_gpt.o
67+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/bl602_sifive_e24_riscv/mcal_gpt.cpp -o bin/mcal_gpt.o
68+
69+
@echo.Compile : mcal_irq.cpp to bin/mcal_irq.o
70+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/bl602_sifive_e24_riscv/mcal_irq.cpp -o bin/mcal_irq.o
71+
72+
@echo.Compile : mcal_led.cpp to bin/mcal_led.o
73+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/bl602_sifive_e24_riscv/mcal_led.cpp -o bin/mcal_led.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/bl602_sifive_e24_riscv/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/bl602_sifive_e24_riscv/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/bl602_sifive_e24_riscv/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/bl602_sifive_e24_riscv/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/bl602_sifive_e24_riscv/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.Assemble : boot.s to bin/boot.o
103+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ %CFLAGS% %CINCLUDES% -c target/micros/bl602_sifive_e24_riscv/startup/boot.s -o bin/boot.o
104+
105+
@echo.Compile : crt0.cpp to bin/crt0.o
106+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/bl602_sifive_e24_riscv/startup/crt0.cpp -o bin/crt0.o
107+
108+
@echo.Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o
109+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/bl602_sifive_e24_riscv/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
110+
111+
@echo.Compile : crt1.cpp to bin/crt1.o
112+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/bl602_sifive_e24_riscv/startup/crt1.cpp -o bin/crt1.o
113+
114+
@echo.Compile : int_vect.c to bin/int_vect.o
115+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% %CINCLUDES% -c target/micros/bl602_sifive_e24_riscv/startup/int_vect.c -o bin/int_vect.o
116+
117+
@echo.Link : objects to bin/chapter12_04a.elf
118+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x none -mrelax -nostartfiles %CFLAGS% %CPPFLAGS% %CINCLUDES% -Wl,--gc-sections -Wl,-Ttarget/micros/bl602_sifive_e24_riscv/make/bl602_sifive_e24_riscv.ld,-Map,bin/chapter12_04a.map bin/app_benchmark.o bin/app_led.o bin/cmath_impl_gamma.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_eep.o bin/mcal_gpt.o bin/mcal_irq.o bin/mcal_led.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/boot.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter12_04a.elf
119+
120+
@echo.
121+
@echo.Extract : executable hex file : from bin/chapter12_04a.elf
122+
@%TOOL_PATH%\%TOOL_PREFIX%-objcopy -O ihex bin/chapter12_04a.elf bin/chapter12_04a.hex
123+
124+
@echo.Extract : assembly list file : from bin/chapter12_04a.elf
125+
@%TOOL_PATH%\%TOOL_PREFIX%-objdump --disassemble bin/chapter12_04a.elf > bin/chapter12_04a.lss
126+
127+
@echo.Extract : size information : from bin/chapter12_04a.elf
128+
@%TOOL_PATH%\%TOOL_PREFIX%-size -A -t bin/chapter12_04a.elf > bin\chapter12_04a_size.txt
129+
130+
@echo.Extract : name information : from bin/chapter12_04a.elf
131+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter12_04a.elf > bin\chapter12_04a_nm.txt
132+
133+
@echo.Extract : demangled names : from bin/chapter12_04a.elf
134+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter12_04a.elf | %TOOL_PATH%\%TOOL_PREFIX%-c++filt > bin\chapter12_04a_cppfilt.txt
135+
136+
dir .\bin\chapter12_04a.elf .\bin\chapter12_04a.hex
137+
138+
rem if not exist .\bin\chapter12_04a.elf exit 1
139+
rem if not exist .\bin\chapter12_04a.hex exit 1
140+
141+
rem exit 0

examples/chapter12_04a/build.sh

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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/avr-g++
15+
# installed, e.g. via command apt-get install gcc-avr avr-libc
16+
# then:
17+
# ./build.sh
18+
#
19+
# Otherwise for custom installations
20+
# ./build.sh directory_of_gcc_bin riscv-none-elf
21+
# For example,
22+
# ./build.sh /usr/bin riscv-none-elf
23+
#
24+
# Usage example A (from *nix shell)
25+
# cd /usr/local/real-time-cpp/examples/chapter12_04a
26+
# ./build.sh /usr/local/real-time-cpp/examples/chapter12_04a/tools/Util/msys64/usr/local/gcc-15.2.0-riscv-none-elf/bin riscv-none-elf
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/chapter12_04a
30+
# ./build.sh C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter12_04a/tools/Util/msys64/usr/local/gcc-15.2.0-riscv-none-elf/bin riscv-none-elf
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 -ffast-math -mcpu=sifive-e24 -mabi=ilp32 -msmall-data-limit=32 -falign-functions=4 -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/bl602_sifive_e24_riscv -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_benchmark.cpp to bin/app_benchmark.o"
65+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/benchmark/app_benchmark.cpp -o bin/app_benchmark.o
66+
67+
echo "Compile : app_led.cpp to bin/app_led.o"
68+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/led/app_led.cpp -o bin/app_led.o
69+
70+
echo "Compile : cmath_impl_gamma.cpp to bin/cmath_impl_gamma.o"
71+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/util/STL/impl/cmath_impl_gamma.cpp -o bin/cmath_impl_gamma.o
72+
73+
echo "Compile : mcal.cpp to bin/mcal.o"
74+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal.cpp -o bin/mcal.o
75+
76+
echo "Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o"
77+
$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
78+
79+
echo "Compile : mcal_cpu.cpp to bin/mcal_cpu.o"
80+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_cpu.cpp -o bin/mcal_cpu.o
81+
82+
echo "Compile : mcal_eep.cpp to bin/mcal_eep.o"
83+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_eep.cpp -o bin/mcal_eep.o
84+
85+
echo "Compile : mcal_gpt.cpp to bin/mcal_gpt.o"
86+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_gpt.cpp -o bin/mcal_gpt.o
87+
88+
echo "Compile : mcal_irq.cpp to bin/mcal_irq.o"
89+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_irq.cpp -o bin/mcal_irq.o
90+
91+
echo "Compile : mcal_led.cpp to bin/mcal_led.o"
92+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_led.cpp -o bin/mcal_led.o
93+
94+
echo "Compile : mcal_osc.cpp to bin/mcal_osc.o"
95+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_osc.cpp -o bin/mcal_osc.o
96+
97+
echo "Compile : mcal_port.cpp to bin/mcal_port.o"
98+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_port.cpp -o bin/mcal_port.o
99+
100+
echo "Compile : mcal_wdg.cpp to bin/mcal_wdg.o"
101+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_wdg.cpp -o bin/mcal_wdg.o
102+
103+
echo "Compile : mcal_pwm.cpp to bin/mcal_pwm.o"
104+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_pwm.cpp -o bin/mcal_pwm.o
105+
106+
echo "Compile : mcal_spi.cpp to bin/mcal_spi.o"
107+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/bl602_sifive_e24_riscv/mcal_spi.cpp -o bin/mcal_spi.o
108+
109+
echo "Compile : os.cpp to bin/os.o"
110+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/os/os.cpp -o bin/os.o
111+
112+
echo "Compile : sys_idle.cpp to bin/sys_idle.o"
113+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/idle/sys_idle.cpp -o bin/sys_idle.o
114+
115+
echo "Compile : sys_mon.cpp to bin/sys_mon.o"
116+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/mon/sys_mon.cpp -o bin/sys_mon.o
117+
118+
echo "Compile : sys_start.cpp to bin/sys_start.o"
119+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/start/sys_start.cpp -o bin/sys_start.o
120+
121+
echo "Assemble :boot.s to bin/boot.o"
122+
$TOOL_PATH/$TOOL_PREFIX-g++ $CFLAGS $CINCLUDES -c target/micros/bl602_sifive_e24_riscv/startup/boot.s -o bin/boot.o
123+
124+
echo "Compile : crt0.cpp to bin/crt0.o"
125+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/bl602_sifive_e24_riscv/startup/crt0.cpp -o bin/crt0.o
126+
127+
echo "Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o"
128+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/bl602_sifive_e24_riscv/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
129+
130+
echo "Compile : crt1.cpp to bin/crt1.o"
131+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/bl602_sifive_e24_riscv/startup/crt1.cpp -o bin/crt1.o
132+
133+
echo "Compile : int_vect.c to bin/int_vect.o"
134+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c $CFLAGS $CINCLUDES -c target/micros/bl602_sifive_e24_riscv/startup/int_vect.c -o bin/int_vect.o
135+
136+
echo "Link : objects to bin/chapter12_04a.elf"
137+
$TOOL_PATH/$TOOL_PREFIX-g++ -x none -mrelax -nostartfiles $CFLAGS $CPPFLAGS $CINCLUDES -Wl,--gc-sections -Wl,-Ttarget/micros/bl602_sifive_e24_riscv/make/bl602_sifive_e24_riscv.ld,-Map,bin/chapter12_04a.map bin/app_benchmark.o bin/app_led.o bin/cmath_impl_gamma.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_eep.o bin/mcal_gpt.o bin/mcal_irq.o bin/mcal_led.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/boot.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter12_04a.elf
138+
139+
echo
140+
echo "Extract : executable hex file : from bin/chapter12_04a.elf"
141+
$TOOL_PATH/$TOOL_PREFIX-objcopy -O ihex bin/chapter12_04a.elf bin/chapter12_04a.hex
142+
143+
echo "Extract : assembly list file : from bin/chapter12_04a.elf"
144+
$TOOL_PATH/$TOOL_PREFIX-objdump --disassemble bin/chapter12_04a.elf > bin/chapter12_04a.lss
145+
146+
echo "Extract : size information : from bin/chapter12_04a.elf"
147+
$TOOL_PATH/$TOOL_PREFIX-size -A -t bin/chapter12_04a.elf > bin/chapter12_04a_size.txt
148+
149+
echo "Extract : name information : from bin/chapter12_04a.elf"
150+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter12_04a.elf > bin/chapter12_04a_nm.txt
151+
152+
echo "Extract : demangled names : from bin/chapter12_04a.elf"
153+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter12_04a.elf | $TOOL_PATH/$TOOL_PREFIX-c++filt > bin/chapter12_04a_cppfilt.txt

0 commit comments

Comments
 (0)