Wiki

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
resources:no-os:build [14 Dec 2021 15:32] – fix some stm32 errors Darius B
Line 1: Line 1:
 +
 +====== NO-OS Project Build Guide ======
 +
 +<note tip>NOTE: This build guide is valid for the projects found in the **no-OS/projects** folder. If your project resides elsewhere under the no-OS repository tree, it is a legacy project. A build guide for legacy projects can be found [[resources:fpga:no-os_make:software_setup|Build no-OS with GNU make]].</note>
 +
 +Clone NO-OS with the ''--recursive'' flag:
 +<code>
 +git clone --recursive https://github.com/analogdevicesinc/no-OS
 +</code>
 +
 +If however you've already cloned NO-OS without the ''--recursive'' flag, you may initialize all the submodules in an existing NO-OS clone with:
 +<code>
 +git submodule update --recursive --init
 +</code>
 +
 +===== Build Prerequisites =====
 +
 +Prior to building a no-OS project, it is required to set up some environment variables so that the build process may find the necessary tools (compiler, linker, SDK etc.).
 +
 +Use the following commands to prepare your environment for building no-OS projects:
 +<hidden Linux (Click to expand)>
 +<hidden Intel (Click to expand)>
 +Assuming the SDK is installed at this path:
 +
 +<code>
 +/path/to/intel
 +└── intelFPGA
 +    └── 18.1
 +</code>
 +
 +Run:
 +<code>
 +$ source no-OS/tools/scripts/platform/intel/environment.sh /path/to/intel/intelFPGA 18.1
 +</code>
 +</hidden>
 +
 +<hidden Xilinx (Click to expand)>
 +Assuming the Vitis is installed at this path:
 +
 +<code>
 +/path/to/xilinx
 +├── DocNav
 +├── Downloads
 +├── SDK
 +│   └── 2019.1
 +└── Vitis
 +    ├── 2020.1
 +    └── 2020.2
 +</code>
 +
 +Run:
 +<code>
 +$ source /path/to/xilinx/Vitis/2020.1/settings64.sh
 +</code>
 +
 +For more information, consult the [[xilinx>support/answers/47821.html]].
 +</hidden>
 +
 +<hidden STM32 (Click to expand)>
 +
 +  * Install [[https://www.st.com/en/development-tools/stm32cubeide.html|stm32cubeide]] to default location ''/opt/stm32cubeide''. If you'd rather install it at a different location, run ''export STM32CUBEDE=/path/to/your/stm32cubeide'' in the terminal used for building.
 +  * Install [[https://www.st.com/en/development-tools/stm32cubemx.html|stm32cubemx]] to default location ''/opt/stm32cubemx''. If you'd rather install it at a different location, run ''export STM32CUBMX=/path/to/your/stm32cubemx'' in the terminal used for building.
 +  * Install ''java'', ''sed'' and ''head'' (if not already present, they normally are).
 +</hidden>
 +
 +<hidden ADuCM3029 (Click to expand)>
 +  * Install the CrossCore Embedded Studio 2.10 (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_setup_guide]])
 +  * Manually Install ''ADuCM302x Device Family Pack (DFP3.2.0+)'' (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide#how_to_install_or_upgrade_packs_for_cces]])
 +  * Manually Install ''ARM.CMSIS pack (5.7.0+)'' (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide#how_to_install_or_upgrade_packs_for_cces]])
 +
 +<note important>Please install all the necessary packs locally and then manually import them in CrossCore</note>
 +
 +Common Issues with environment setup:
 +  * Makefiles searches for the CCES_HOME in its default installation directory. It may happen that multiple version are installed and may not work. To select a ''CCES_HOME'' run ''export CCES_HOME=/opt/analog/cces/2.10.0''
 +</hidden>
 +</hidden>
 +
 +<hidden Windows (Click to expand)>
 +<hidden Intel (Click to expand)>
 +Assuming the SDK is installed at this path:
 +
 +<code>
 +C:\
 +└── intelFPGA
 +    └── 18.1
 +</code>
 +
 +Run:
 +<code>
 +> .\no-OS\tools\scripts\platform\altera\environment.bat C:\intelFpga 18.1
 +</code>
 +</hidden>
 +
 +<hidden Xilinx (Click to expand)>
 +Assuming the SDK is installed at this path:
 +<code>
 +C:\Xilinx
 +├── DocNav
 +├── Downloads
 +├── SDK
 +│   └── 2019.1
 +└── Vitis
 +    ├── 2020.1
 +    └── 2020.2
 +</code>
 +
 +Run:
 +<code>
 +> C:\Xilinx\SDK\2020.1\settings64.bat
 +</code>
 +
 +For more information, consult the Xilinx support [[xilinx>support/answers/47821.html]].
 +
 +<note important>
 +Note that Xilinx SDK versions 2018.3 or earlier don't properly set up the Windows PATH so that you may use **make** command provided with the SDK from the shell.
 +</note>
 +
 +If this is the case, please manually add the following to your Windows PATH or install **make** for Windows of your choice:
 +<code>
 +C:\Xilinx\SDK\2018.3\gnuwin\bin
 +</code>
 +</hidden>
 +
 +<hidden ADuCM3029 (Click to expand)>
 +  * Install [[http://gnuwin32.sourceforge.net/packages/make.htm|GNUWin32']] ''make''
 +  * Install the CrossCore Embedded Studio (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_setup_guide]])
 +  * Manually Install ''ADuCM302x Device Family Pack (DFP3.2.0+)'' (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide#how_to_install_or_upgrade_packs_for_cces]])
 +  * Manually Install ''ARM.CMSIS pack (5.7.0+)'' (refer to [[resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide#how_to_install_or_upgrade_packs_for_cces]])
 +
 +<note important>Please install all the necessary packs locally and then manually import them in CrossCore </note>
 +
 +Common Issues with environment setup:
 +  * Makefiles searches for the CCES_HOME in its default installation directory. It may happen that multiple version are installed and may not work. To select a ''CCES_HOME'' run ''set CCES_HOME=c:\Analog Devices\CrossCore Embedded Studio 2.10.0''
 +</hidden>
 +
 +<note important>
 +If using PowerShell instead of cmd, open another shell instance after running the above scripts.
 +</note>
 +
 +</hidden>
 +
 +===== Building a project =====
 +
 +Go in the project directory that should be built.
 +
 +<hidden Linux (Click to expand)>
 +
 +<code>
 +$ cd no-OS/projects/project_name/
 +$ tree
 +.
 +├── builds.json
 +├── Makefile
 +├── src
 +└── src.mk
 +</code>
 +
 +<hidden Intel (Click to expand)>
 +Copy the **.sof** and **.sopcinfo** to the project folder.
 +
 +<code>
 +$ ls
 +Makefile  profiles  src  src.mk  system_bd.sopcinfo  adrv9009_a10gx.sof
 +$ make
 +
 +# Alternatively you may select a .sopcinfo file explicitly by:
 +$ make HARDWARE=path/to/system_bd.sopcinfo
 +</code>
 +</hidden>
 +
 +<hidden Xilinx (Click to expand)>
 +Copy the **.hdf** in the project folder.
 +
 +<code>
 +$ ls
 +Makefile  profiles  src  src.mk system_top.hdf
 +$ make
 +
 +# Alternatively you may select an .hdf file explicitly by:
 +$ make HARDWARE=path/to/file.hdf
 +</code>
 +</hidden>
 +
 +<hidden STM32 (Click to expand)>
 +Make sure you have the .ioc file in the project directory, then type:
 +<code>
 +$ make
 +</code>
 +</hidden>
 +
 +<hidden ADuCM3029 (Click to expand)>
 +The ADuCM3029 projects also contain a ''pinmux_config.c'' file which contains pin configuration instructions.
 +
 +<code>
 +# build an ADuCM3029-only project
 +$ make
 +
 +# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM
 +$ make PLATFORM=aducm3029
 +</code>
 +</hidden>
 +
 +</hidden>
 +
 +<hidden Windows (Click to expand)>
 +<note important>
 +CMD needs to be run with **administrative** privileges to create a project.
 +
 +If this is not possible, check the standalone section.
 +</note>
 +<code>
 +> cd .\no-OS\projects\project_name\
 +</code>
 +
 +It should contain make-related files and source files:
 +<code>
 +.\no-OS\projects\project_name\
 +├── builds.json
 +├── Makefile
 +├── src
 +└── src.mk
 +</code>
 +
 +<hidden Intel (Click to expand)>
 +Copy the **.sof** and **.sopcinfo** to the project folder and run:
 +<code>
 +.\no-OS\projects\adrv9009\
 +├── Makefile
 +├── profiles
 +├── src
 +├── src.mk
 +├── system_bd.sopcinfo
 +└── adrv9009_a10gx.sof
 +
 +> make
 +</code>
 +</hidden>
 +
 +<hidden Xilinx (Click to expand)>
 +Copy the **.hdf** to the project folder and run:
 +<code>
 +.\no-OS\projects\adrv9009\
 +├── Makefile
 +├── profiles
 +├── src
 +├── src.mk
 +└── system_top.hdf
 +
 +> make
 +</code>
 +</hidden>
 +
 +<hidden ADuCM3029 (Click to expand)>
 +The ADuCM3029 projects also contain a ''pinmux_config.c'' file which contains pin configuration instructions.
 +
 +<code>
 +# build an ADuCM3029-only project
 +> make
 +
 +# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM
 +> make PLATFORM=aducm3029
 +</code>
 +</hidden>
 +
 +</hidden>
 +
 +The build process creates a **build** directory in the project folder:
 +
 +<code>
 +build
 +├── app
 +├── bsp
 +├── obj
 +├── release.elf
 +└── tmp
 +</code>
 +
 +
 +
 +===== Debugging/Running =====
 +
 +Once the ''.elf'' or ''.hex'' file has been generated, make sure the board is powered on, JTAG cable connected and use the following commands to upload the program to the board or debug.
 +
 +Uploading the binary to target is generically achieved with:
 +<code>
 +$ make run
 +</code>
 +
 +However, debugging interface might be different across platforms and the specifics are documented below.
 +<hidden Linux (Click to expand)>
 +<hidden Xilinx (Click to expand)>
 +Use the following command to launch XSDK to be able to debug graphically by clicking the debug button. <code>
 +$ make develop
 +</code>
 +
 +A debug configuration is created automatically, debugging should work out of the box.
 +</hidden>
 +
 +<hidden ADuCM3029 (Click to expand)>
 +Use the following command to launch CCES to be able to debug graphically by clicking the debug button. 
 +<code>
 +$ make develop
 +</code>
 +However, a debug configuration must be created first by following the debug session configuration section of [[:resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide|this guide]].
 +</hidden>
 +
 +<hidden STM32 (Click to expand)>
 +If you prefer using plain ''gdb'' in TUI mode, you may debug any stm32 target from a terminal using the following command:
 +<code>
 +$ make debug
 +</code>
 +
 +Alternatively, you may open the project in the SDK and debug as usual by launching the Eclipse debugger:
 +
 +<code>
 +$ make develop
 +</code>
 +</hidden>
 +</hidden>
  
resources/no-os/build.txt · Last modified: 06 Mar 2024 11:49 by Esteban Blanc