2023-09-09 07:03:56 +00:00
|
|
|
|
2023-09-25 06:12:08 +00:00
|
|
|
@echo off
|
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-25 06:12:08 +00:00
|
|
|
:: Compile directly in windows without the need of a linux virtual machine:
|
2023-09-21 22:06:47 +00:00
|
|
|
::
|
|
|
|
:: 1. Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm
|
|
|
|
:: 2. Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm
|
2023-09-25 06:12:08 +00:00
|
|
|
::
|
2023-09-25 12:27:52 +00:00
|
|
|
:: 3. You may (or may not) need to manualy add a path to you OS environment PATH, ie ..
|
2023-09-21 22:06:47 +00:00
|
|
|
:: C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin
|
2023-09-25 06:12:08 +00:00
|
|
|
::
|
2023-09-25 12:27:52 +00:00
|
|
|
:: 4. You may (or may not) need to reboot windows after installing the above
|
2023-09-21 22:06:47 +00:00
|
|
|
::
|
2023-09-27 16:29:49 +00:00
|
|
|
:: You can then run this bat from the directory you saved the firmware source code too.
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
2023-09-09 07:03:56 +00:00
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
2023-09-27 16:29:49 +00:00
|
|
|
:: Delete any left over files from previous compile
|
2023-09-25 12:27:52 +00:00
|
|
|
::
|
2023-09-09 07:03:56 +00:00
|
|
|
del /S /Q *.o >nul 2>nul
|
|
|
|
del /S /Q *.d >nul 2>nul
|
2023-09-25 06:12:08 +00:00
|
|
|
del /Q firmware >nul 2>nul
|
2023-09-24 15:57:31 +00:00
|
|
|
del /Q *.bin >nul 2>nul
|
2023-09-21 22:06:47 +00:00
|
|
|
|
2023-09-25 06:12:08 +00:00
|
|
|
:: You may need to edit/change these three paths to suit your setup
|
|
|
|
::
|
2023-09-27 16:29:49 +00:00
|
|
|
:: Temporarily add the compiler and make program directories to the system PATH ..
|
|
|
|
::
|
2023-09-25 06:12:08 +00:00
|
|
|
@set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin";%PATH%
|
|
|
|
@set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\bin";%PATH%
|
|
|
|
@set PATH="C:\Program Files (x86)\GnuWin32\bin\";%PATH%
|
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
:: Do the compile
|
|
|
|
::
|
2023-09-27 16:29:49 +00:00
|
|
|
make clean
|
2023-09-25 06:12:08 +00:00
|
|
|
make
|
2023-09-21 22:06:47 +00:00
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
:: Delete the spent files
|
2023-09-25 06:12:08 +00:00
|
|
|
::
|
2023-09-09 07:03:56 +00:00
|
|
|
del /S /Q *.o >nul 2>nul
|
|
|
|
del /S /Q *.d >nul 2>nul
|
2023-09-25 06:12:08 +00:00
|
|
|
del /Q firmware >nul 2>nul
|
2023-09-09 07:03:56 +00:00
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-18 12:31:56 +00:00
|
|
|
:: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
|
2023-09-21 07:46:24 +00:00
|
|
|
:: The Quansheng windows upload-to-radio program requires a 'packed' .bin file.
|
2023-09-18 12:31:56 +00:00
|
|
|
::
|
2023-09-21 22:06:47 +00:00
|
|
|
:: if you don't have python installed, then you can still upload the standard unpacked firmware.bin
|
|
|
|
:: file another way ...
|
2023-09-21 06:31:29 +00:00
|
|
|
::
|
2023-09-21 22:06:47 +00:00
|
|
|
:: I wrote a GUI version of k5prog to do this easily in windows ..
|
2023-09-18 12:31:56 +00:00
|
|
|
:: https://github.com/OneOfEleven/k5prog-win
|
2023-09-21 06:31:29 +00:00
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
2023-09-27 16:29:49 +00:00
|
|
|
:: One of these two lines simply install the required python module if you want to create the packed
|
2023-09-25 12:27:52 +00:00
|
|
|
:: firmware bin file, either only needs running once, ever.
|
2023-09-21 22:06:47 +00:00
|
|
|
::
|
2023-09-21 06:31:29 +00:00
|
|
|
::python -m pip install --upgrade pip crcmod
|
|
|
|
::python3 -m pip install --upgrade pip crcmod
|
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
2023-09-21 22:06:47 +00:00
|
|
|
:: show the compiled .bin file size
|
2023-09-25 12:27:52 +00:00
|
|
|
::
|
2023-09-09 07:03:56 +00:00
|
|
|
::arm-none-eabi-size firmware
|
|
|
|
|
2023-09-25 12:27:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-09 07:03:56 +00:00
|
|
|
pause
|
2023-09-25 12:27:52 +00:00
|
|
|
@echo on
|