win_make.bat 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. @echo off
  2. :: Compile directly in windows without the need of a linux virtual machine:
  3. ::
  4. :: 1. Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm
  5. :: 2. Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm
  6. ::
  7. :: 3. You may (or may not) need to manualy add a path to you OS environment PATH, ie ..
  8. :: C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin
  9. ::
  10. :: 4. You may (or may not) need to reboot windows after installing the above
  11. ::
  12. :: You can then run this bat from the directory you saved the firmware source code too.
  13. :: You may need to edit/change these three paths to suit your setup
  14. ::
  15. :: Temporarily add the compiler and make program directories to the system PATH ..
  16. ::
  17. @set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin";%PATH%
  18. @set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\bin";%PATH%
  19. @set PATH="C:\Program Files (x86)\GnuWin32\bin\";%PATH%
  20. :: Do the compile
  21. ::
  22. make clean
  23. make
  24. :: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
  25. :: The Quansheng windows upload-to-radio program requires a 'packed' .bin file.
  26. ::
  27. :: if you don't have python installed, then you can still upload the standard unpacked firmware.bin
  28. :: file another way ...
  29. ::
  30. :: I wrote a GUI version of k5prog to do this easily in windows ..
  31. :: https://github.com/OneOfEleven/k5prog-win
  32. :: One of these two lines simply install the required python module if you want to create the packed
  33. :: firmware bin file, either only needs running once, ever.
  34. ::
  35. ::python -m pip install --upgrade pip crcmod
  36. ::python3 -m pip install --upgrade pip crcmod
  37. :: show the compiled .bin file size
  38. ::
  39. ::arm-none-eabi-size firmware
  40. pause
  41. @echo on