|
9 | 9 |
|
10 | 10 | @rem |
11 | 11 | @rem Usage: |
12 | | -@rem build.bat directory_of_gcc_bin prefix_of_avr_gcc |
| 12 | +@rem build.bat directory_of_gcc_bin prefix_of_gcc-arm-non-eabi |
13 | 13 |
|
14 | 14 | @rem Usage example A, |
15 | 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 |
| 16 | +@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter12_04a\tools\Util\msys64\usr\local\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi |
17 | 17 |
|
18 | 18 | @rem Usage example A1 (use a relative tool path), |
19 | 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 |
| 20 | +@rem build.bat ".\tools\Util\msys64\usr\local\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi |
21 | 21 |
|
22 | 22 | @rem Usage example B, |
23 | 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 |
| 24 | +@rem build.bat "C:\Program Files (x86)\gcc-14.2.1-arm-none-eabi\bin" arm-none-eabi |
25 | 25 |
|
26 | 26 |
|
27 | 27 | @set TOOL_PATH=%1 |
28 | 28 | @set TOOL_PREFIX=%2 |
29 | 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 |
| 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 | 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 |
| 32 | +@set CINCLUDES=-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc/mcal/stm32f100 -Isrc |
33 | 33 |
|
34 | 34 | @echo. |
35 | 35 | @echo.Building with : build.bat |
|
58 | 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 | 59 |
|
60 | 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 |
| 61 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_cpu.cpp -o bin/mcal_cpu.o |
62 | 62 |
|
63 | 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 |
| 64 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_eep.cpp -o bin/mcal_eep.o |
65 | 65 |
|
66 | 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 |
| 67 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_gpt.cpp -o bin/mcal_gpt.o |
68 | 68 |
|
69 | 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 |
| 70 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_irq.cpp -o bin/mcal_irq.o |
71 | 71 |
|
72 | 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 |
| 73 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_led.cpp -o bin/mcal_led.o |
74 | 74 |
|
75 | 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 |
| 76 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_osc.cpp -o bin/mcal_osc.o |
77 | 77 |
|
78 | 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 |
| 79 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_port.cpp -o bin/mcal_port.o |
80 | 80 |
|
81 | 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 |
| 82 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_pwm.cpp -o bin/mcal_pwm.o |
83 | 83 |
|
84 | 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 |
| 85 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_spi.cpp -o bin/mcal_spi.o |
86 | 86 |
|
87 | 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 |
| 88 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/stm32f100/mcal_wdg.cpp -o bin/mcal_wdg.o |
89 | 89 |
|
90 | 90 | @echo.Compile : os.cpp to bin/os.o |
91 | 91 | @%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/os/os.cpp -o bin/os.o |
|
99 | 99 | @echo.Compile : sys_start.cpp to bin/sys_start.o |
100 | 100 | @%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/sys/start/sys_start.cpp -o bin/sys_start.o |
101 | 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 | 102 | @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 |
| 103 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/crt0.cpp -o bin/crt0.o |
107 | 104 |
|
108 | 105 | @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 |
| 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 |
110 | 107 |
|
111 | 108 | @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 |
| 109 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/crt1.cpp -o bin/crt1.o |
113 | 110 |
|
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 |
| 111 | +@echo.Compile : int_vect.cpp to bin/int_vect.o |
| 112 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CINCLUDES% -c target/micros/stm32f100/startup/int_vect.cpp -o bin/int_vect.o |
116 | 113 |
|
117 | 114 | @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 |
| 115 | +@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x none -nostartfiles %CFLAGS% %CPPFLAGS% %CINCLUDES% -Wl,--gc-sections -Wl,-Ttarget/micros/stm32f100/make/stm32f100.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/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter12_04a.elf |
119 | 116 |
|
120 | 117 | @echo. |
121 | 118 | @echo.Extract : executable hex file : from bin/chapter12_04a.elf |
|
135 | 132 |
|
136 | 133 | dir .\bin\chapter12_04a.elf .\bin\chapter12_04a.hex |
137 | 134 |
|
138 | | -rem if not exist .\bin\chapter12_04a.elf exit 1 |
139 | | -rem if not exist .\bin\chapter12_04a.hex exit 1 |
| 135 | +if not exist .\bin\chapter12_04a.elf exit 1 |
| 136 | +if not exist .\bin\chapter12_04a.hex exit 1 |
140 | 137 |
|
141 | | -rem exit 0 |
| 138 | +exit 0 |
0 commit comments