Wiki

This version (06 Dec 2023 08:51) was approved by Mahesh Phalke.The Previously approved version (26 Sep 2023 08:47) is available.Diff

Precision Converters Firmware Build Guide

NOTE: For Local build (i.e., non-web-based build), the firmware repository needs to be cloned manually into local drive of your computer. For Remote/web/online build (supported by Mbed platform), cloning of the repository is not required.

Clone Precision Converters Firmware repository with the --recursive flag (not needed if building with web IDE for Mbed platform):

git clone --recursive https://github.com/analogdevicesinc/precision-converters-firmware

If however you've already cloned the repository without the --recursive flag, you may initialize all the submodules in an existing cloned repo with:

git submodule update --recursive --init

Build Prerequisites

Prior to building a firmware project, it is required to set up an environment so that the build process may find the necessary tools (compiler, linker, SDK etc.). Use the following steps to prepare your environment for building firmware projects for respective platform.

Windows (Click to expand)

Windows (Click to expand)

STM32 (Click to expand)

STM32 (Click to expand)

Build using STM32 IDE (click to expand)

Build using STM32 IDE (click to expand)

Install the following tools on your computer


Add the path “GnuWin32/bin” to the environment variables. For this, make sure to install 'make' in the root of 'C' drive without any spaces in the installation path. The path must be C:\GnuWin32\…

05 Oct 2023 11:31 · Janani Sunil

Mbed (Click to expand)

Mbed (Click to expand)

For Web/Online Build (Click to expand)

For Web/Online Build (Click to expand)

  • Visit Arm Keil website to create an user account for accessing the web based Keil Studio IDE. Keil Arm
  • Open Keil Studio Web IDE with registered user account

For Make Build (Click to expand)

For Make Build (Click to expand)

  • Install Make in the root of 'C' drive without any spaces in the installation path. The path must be C:\GnuWin32\… https://gnuwin32.sourceforge.net/packages/make.htm
  • Add the path of GnuWin32/bin directory into the system environmental path variable (as shown in below screenshot).
  • Add the path of Git/usr/bin directory into system environmental path variable.
  • Install GNU Arm Embedded compiler (for the development, 9-2019-q4-major version is used).https://developer.arm.com/downloads/-/gnu-rm.
  • Add the path of GNU Arm Embedded Toolchain bin directory to system environmental path variable.
  • Configure the compiler location with Mbed CLI. This can be carried out by running the “mbed config -G GCC_ARM_PATH “path-to-your-gcc-compiler”” in Command Prompt. For example you can run mbed config -G GCC_ARM_PATH “C:\Program Files (x86)\GNU Tools ARM Embedded\9 2019-q4-major\bin” in command prompt. It will set mentioned compiler path to all the Mbed Projects.

Building a project

Windows (Click to expand)

Windows (Click to expand)

STM32 (Click to expand)

STM32 (Click to expand)

Build using STM32 IDE (click to expand)

Build using STM32 IDE (click to expand)

  • Open the respective project directory by navigating into the “precision_converters_firmware/projects/” folder.
  • In the “STM32” folder present within the project directory, double click and open the .ioc file present within.

  • Click on the “Generate Code” option seen on the top right corner

  • Upon successful generation of drivers for the selected MCU, the autogenerated files would be seen in the same directory where the .ioc file was present. Double click and open the “.project” file seen in the list of files

  • After the project is loaded to the STM32CubeIDE, unfold the adxxxx_iio project seen in the project explorer, right click the “app” folder, select “Settings” under the “C/C++ Build” section on the left pane and un-check the “Exclude resources from build” checkbox. This would ensure that the project specific files are included by the build system

  • In order to choose STM32 platform in the firmware, select the “ACTIVE_PLATFORM” as “STM32_PLATFORM” in the app_config.h from the project files.

  • Add compiler flags “-u _printf_float” to the project settings.

  • Program by clicking on the “Run adxxxx_iio” option seen or by performing a copy→paste option of the .hex file seen in the STM32/Debug folder

26 May 2023 15:45 · Janani Sunil

Mbed (Click to expand)

Mbed (Click to expand)

Build Using Web/Online IDE (Click to expand)

Build Using Web/Online IDE (Click to expand)

  • Clone the Precision Converters Firmware repository into Keil Studio using “File→clone…” menu. The link to github repository is here: precision-converters-firmware

  • Once the project repository is imported, wait until all library dependencies are imported as shown in below screenshot. Now, open the '.medignore' file present in the root directory of repository. Add comment syntax (two forward slashes) in front of the project name which you want to build. This will ignore all other projects and build only the comment syntax selected project.

  • Select the target device (default used for development is SDP-K1) and click on 'Clean build' option to build the project. After a successful build a binary will be downloaded to your computer- store this on your drive. Drag and drop this binary to the USB drive hosted by your controller board to flash the MCU.

Note: If you intend to build different project, then modify the .medignore file in the root directory as mentioned in step2 and clean build project as mentioned in step3

Build Using Make (Click to expand)

Build Using Make (Click to expand)

  • Open Git bash and change current directory to project directory (eg. “precision-converters-firmware/projects/ad4130_iio” directory) which you want to build.
  • Run make command to build the project.
  • After successful build, binary file is created into the Project_Name/build directory.
  • To clean build, run make reset command which deletes all generated build files for the given project.
NOTE: Default TARGET_BOARD is SDP_K1 and COMPILER is GCC_ARM. Current Make based build only support GCC_ARM Compiler.
  • By default project is built for “SDP_K1” Board and “GCC_ARM” Compiler. If you want to build for other Mbed Board, For example If you want to build the project for “DISCO_F769NI” Board then run make TARGET_BOARD=DISCO_F769NI command in Command Prompt. Run make reset TARGET_BOARD=DISCO_F769NI command in Command Prompt to delete the generated build files for the given project.

Running a project

Once the firmware build is successful and binary file is generated, copy the generated binary into USB drive hosted by your MCU board (e.g. USB drive hosted by SDP-K1 board on windows). This will flash the binary file into MCU present on the controller board.

resources/tools-software/product-support-software/pcg-fw-mbed-build-guide.txt · Last modified: 06 Dec 2023 08:51 by Mahesh Phalke