xjtuecho / DS213_ECHO

A customized DS213 APP firmware.
GNU General Public License v3.0
47 stars 9 forks source link

[Solved] How to build the firmware? #3

Open Combinacijus opened 1 year ago

Combinacijus commented 1 year ago

Hey, I'm not familiar with arm-none-eabi-gcc or how to build SMT32 firmware. Could you give some link to a tutorial or maybe write guide how to build this repository? Do I need STM32CubeIDE or VSCode is just as good and building is done through CLI?

If I'd figure out I would update README with step by step tutorial for others too. Also I want to do some minor changes to the code.

Any help is appreciated

Combinacijus commented 1 year ago

Ok figured it out. I missed that there is a Makefile. Googling "how to build a projects with makefile" should point to the right direction. But here's some steps:

Windows setup

One time dependency setup

  1. Install gcc-arm-none-eabi download from. I used latest version (arm-none-eabi-gcc.exe (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)) for windows there was only 32bit version so that's ok
  2. Install make 2.1. Open Powershell as admin (must be admin) 2.2. Run choco install make. After that make can be used without admin
  3. Fully close and reopen vscode and terminal that you gonna use for building

Build project on Windows

  1. [Optional] You can increment app version in file Program\APP\Main.c around line 86 u8 APP_VERSION[12] = { "v20.11.27" };
  2. Open Powershell terminal.
  3. Navigate to the project folder e.g. with command cd C:\GitHub\DS213_ECHO inside which Makefile is located
  4. Run command make. This will create new build folder with build files
  5. Only file you need is build/DS213_ECHO.hex
  6. Then follow firmware update instructions as usual but use your new .hex file

I'd like a confirmation that FPGA_CFG.ADR and STMU_213_018.bin file will remain the same and there's no need to change them. Already tested on my own DS213 and update worked. But not sure what STMU_213_018.bin does. And this issue could be closed but I'll keep it open for now for better visibility