forked from EBiCS/EBiCS_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Start_Compiling.bat
40 lines (32 loc) · 1.04 KB
/
Start_Compiling.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
set eclipsepath=%~1
set stmpath=%~2
set flashoption=%~3
PATH = %PATH%;%eclipsepath%\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825\tools\make;%eclipsepath%\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.17.0.201812190825\tools\compiler\bin;%stmpath%\STM32 ST-LINK Utility\ST-LINK Utility
IF NOT exist Debug (md Debug)
cd Debug
make -f ..\make\Makefile clean
cd..\make
copy *.* ..\Debug
cd ..\Debug
md Drivers\STM32F1xx_HAL_Driver\Src
md startup
md src
copy subdir_drivers.mk Drivers\STM32F1xx_HAL_Driver\Src\subdir.mk
copy subdir_src.mk Src\subdir.mk
copy subdir_startup.mk startup\subdir.mk
IF "%flashoption%"=="STLink" (
copy STLINK_FLASH.ld ..\STM32F103C6Tx_FLASH.ld
copy STLINK_system_stm32f1xx.c ..\Src\system_stm32f1xx.c
) ELSE (
copy UART_FLASH.ld ..\STM32F103C6Tx_FLASH.ld
copy UART_system_stm32f1xx.c ..\Src\system_stm32f1xx.c
)
make all
IF "%flashoption%"=="STLink" (
ST-LINK_CLI.exe -c SWD -P LishuiFOC_01.hex -V
) ELSE (
hex2lsh.jar
lishuiFlash %~4 LishuiFOC_01.lsh
)
pause
exit