Wiki

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:no-os:build [15 Sep 2021 10:39] – [Build Prerequisites] Ramona Alexandra Nechitaresources:no-os:build [06 Mar 2024 11:49] (current) – Run: add remote flash instruction for Xilinx platform Esteban Blanc
Line 1: Line 1:
- +====== No-OS Build Guide ======
-====== 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> <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>
Line 20: Line 19:
 Use the following commands to prepare your environment for building no-OS projects: Use the following commands to prepare your environment for building no-OS projects:
 <hidden Linux (Click to expand)> <hidden Linux (Click to expand)>
 +
 +<note important>
 +Make sure the GNU Make version you are using is >= 4.2.
 +</note>
 +
 <hidden Intel (Click to expand)> <hidden Intel (Click to expand)>
 Assuming the SDK is installed at this path: Assuming the SDK is installed at this path:
Line 36: Line 40:
  
 <hidden Xilinx (Click to expand)> <hidden Xilinx (Click to expand)>
-Assuming the SDK is installed at this path:+Assuming the Vitis 2022.2 is installed at this path:
  
 <code> <code>
 /path/to/xilinx /path/to/xilinx
-└── Xilinx +├── DocNav 
-    ├── DocNav +├── Downloads 
-    ├── Downloads +└── Vitis 
-    ├── SDK +    └── 2022.2
-    │   ├── 2017.4 +
-    │   └── 2018.3 +
-    ├── Vivado +
-    │   ├── 2017.4 +
-    │   └── 2018.+
-    └── xic+
 </code> </code>
  
 Run: Run:
 <code> <code>
-$ source /path/to/xilinx/Xilinx/SDK/2018.3/settings64.sh+$ source /path/to/xilinx/Vitis/2022.2/settings64.sh
 </code> </code>
- 
-For more information, consult the [[xilinx>support/answers/47821.html]]. 
 </hidden> </hidden>
  
 <hidden STM32 (Click to expand)> <hidden STM32 (Click to expand)>
-Download your relevant STM32Cube package by cloning from STMicroelectronics github repo: 
-<code> 
-$ cd /path/to/stm32cube 
-$ git clone https://github.com/STMicroelectronics/STM32CubeF4.git 
-$ tree . 
-/path/to/stm32cube 
-├── STM32CubeF0 
-├── STM32CubeF4 
-├── STM32CubeL0 
-└── STM32CubeL1 
-</code> 
  
-Run+  * 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 STM32CUBEIDE=/path/to/your/stm32cubeide'' in the terminal used for building. 
-<code+  * 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 STM32CUBEMX=/path/to/your/stm32cubemx'' in the terminal used for building. 
-$ export STM32CUBE=/path/to/stm32cube +  * Currently we are testing projects with CubeMx Version 6.5.0, but other versions should work as well. 
-</code>+  * Install ''java'' (openjdk-17), ''sed'' and ''head'' (if not already present, they normally are). 
 +  * Install python (if not already present) and make sure python command executes Python3 (not Python2). This can be easily achieved by running the following command ''sudo apt install python-is-python3''. 
 +</hidden
 + 
 +<hidden Maxim (Click to expand)> 
 +  * Install the [[maxim>en/design/software-description.html/swpart=SFW0018720A|Maxim Micros SDK]].  
 +  * Set the MAXIM_LIBRARIES environment variable to the MaximSDK/Libraries path (the default should be ~/MaximSDK/Libraries). 
 +  * For visual debugging and building, install ''Visual Studio Code'', and the ''Cortex-Debug'' extension. 
 +</hidden> 
 + 
 +<hidden Mbed (Click to expand)> 
 +  * Install Mbed CLI 1 as per guide here: [[https://os.mbed.com/docs/mbed-os/v6.15/build-tools/install-and-set-up.html]] .Usually the following steps should be sufficient: ''sudo apt install python3 python3-pip git mercurial gcc-arm-none-eabi'' and ''sudo python3 -m pip install mbed-cli pyelftools==0.29''
 +  * 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. 
 +</hidden> 
 + 
 +<hidden Pico (Click to expand)> 
 +  * Clone the [[https://github.com/raspberrypi/pico-sdk| Raspberry Pico SDK]].  
 +  * Set the PICO_SDK_PATH environment variable to the pico-sdk cloned repository path. 
 +  * Install the [[https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack | J-Link software ]] 
 +  * Set the JLINK_SERVER_PATH environment variable to the JLinkGDBServerCLExe path (the default path should be /opt/SEGGER/JLink/JLinkGDBServerCLExe). 
 +  * For visual debugging and building, install ''Visual Studio Code'', and the ''Cortex-Debug'' extension.
 </hidden> </hidden>
  
Line 92: Line 97:
  
 <hidden Windows (Click to expand)> <hidden Windows (Click to expand)>
-<hidden Intel (Click to expand)> 
-Assuming the SDK is installed at this path: 
  
-<code+<note important
-C:\ +Open up a Git Bash as Administrator once and run the ''tools/scripts/git-bash.sh'' script. Close the window. You only need to do this once per Git Bash installation
-└── intelFPGA +</note>
-    └── 18.1 +
-</code>+
  
-Run: +<note important
-<code+Use Git Bash (unelevated) for the rest of your development
-.\no-OS\tools\scripts\platform\altera\environment.bat C:\intelFpga 18.1 +</note>
-</code> +
-</hidden>+
  
 <hidden Xilinx (Click to expand)> <hidden Xilinx (Click to expand)>
-Assuming the SDK is installed at this path:+Assuming the Vitis 2022.2 is installed at this path:
 <code> <code>
-C:\ +C:\Xilinx 
-└── Xilinx +├── DocNav 
-    ├── DocNav +├── Downloads 
-    ├── Downloads +└── Vitis 
-    ├── SDK +    └── 2022.2
-    │   ├── 2017.4 +
-    │   └── 2018.3 +
-    ├── Vivado +
-    │   ├── 2017.4 +
-    │   └── 2018.+
-    └── xic+
 </code> </code>
  
 Run: Run:
 <code> <code>
-> C:\Xilinx\SDK\2018.3\settings64.bat+$ export PATH=/c/Xilinx/Vitis/2022.2/bin:/c/Xilinx/Vitis/2022.2/gnu/aarch64/nt/aarch64-none/bin/:$PATH
 </code> </code>
 +</hidden>
  
-For more information, consult the Xilinx support [[xilinx>support/answers/47821.html]]. +<hidden Maxim (Click to expand)> 
- +  * Install the [[maxim>en/design/software-description.html/swpart=SFW0010820A|Maxim Micros SDK]] to a path without whitespaces like ''C:\MaximSDK''.  
-<note important> +  Set the MAXIM_LIBRARIES environment variable by running: ''export MAXIM_LIBRARIES=/c/MaximSDK/Libraries''
-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+  * (Optional) For visual debugging and building, install ''Visual Studio Code''and the ''Cortex-Debug'' extension.
-</note> +
- +
-If this is the caseplease 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>
  
 <hidden ADuCM3029 (Click to expand)> <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]]) to a path without whitespaces such as ''C:\ADI\cces2.11.1''.
-  * 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 ''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]])   * 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]])
 +  * Set the CCES_HOME environment variable to point to the CrossCore Embedded Studio installation directory: ''export CCES_HOME=/c/ADI/cces2.11.1''.
  
-<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> </hidden>
- 
-<note important> 
-If using PowerShell instead of cmd, open another shell instance after running the above scripts. 
-</note> 
- 
 </hidden> </hidden>
  
Line 188: Line 167:
  
 <hidden Xilinx (Click to expand)> <hidden Xilinx (Click to expand)>
-Copy the **.hdf** in the project folder.+Copy the **.xsa** in the project folder.
  
 <code> <code>
 $ ls $ ls
-Makefile  profiles  src  src.mk system_top.hdf+Makefile  profiles  src  src.mk system_top.xsa
 $ make $ make
  
-# Alternatively you may select an .hdf file explicitly by: +# Alternatively you may select an .xsa file explicitly by: 
-$ make HARDWARE=path/to/file.hdf+$ make HARDWARE=path/to/file.xsa 
 +</code> 
 +</hidden> 
 + 
 +<hidden Maxim (Click to expand)> 
 +To build a project, type: 
 +<code> 
 +make PLATFORM=maxim TARGET=... 
 +</code> 
 +The ''TARGET'' specifies the chip for which the project is built. If it is missing, ''max32660'' will be used. At the moment, the available targets are: ''max32650'', ''max32655'', ''max32660'', ''max32665'', ''max32670'', ''max32690'' and ''max78000''.  
 +</hidden> 
 + 
 +<hidden Mbed (Click to expand)> 
 +To build a project, type: 
 +<code> 
 +make PLATFORM=mbed 
 +</code> 
 +</hidden> 
 + 
 +<hidden Pico (Click to expand)> 
 +To build a project, type: 
 +<code> 
 +make PLATFORM=pico
 </code> </code>
 </hidden> </hidden>
  
 <hidden STM32 (Click to expand)> <hidden STM32 (Click to expand)>
 +Make sure you have the .ioc file in the project directory, then type:
 <code> <code>
 $ make PLATFORM=stm32 $ make PLATFORM=stm32
 </code> </code>
 +
 +If during the project generation you get a dialog saying that you are using an .ioc file generated with an old CubeMX version, click ''Continue''. ''Migrate'' is also a valid option but only if you know what you are doing.
 +
 +If you're trying to use an .ioc file generated with a newer CubeMX than the one installed on your machine, you will get a prompt that asks you to upgrade your installation to the new version, there is no other choice than to click ''OK'' and then manually upgrade.
 </hidden> </hidden>
  
Line 222: Line 228:
 <hidden Windows (Click to expand)> <hidden Windows (Click to expand)>
 <note important> <note important>
-CMD needs to be run with **administrative** privileges to create a project. +Use Git Bash to run these commands.
- +
-If this is not possible, check the standalone section.+
 </note> </note>
 <code> <code>
-cd .\no-OS\projects\project_name\+cd no-OS/projects/project_name
 </code> </code>
  
 It should contain make-related files and source files: It should contain make-related files and source files:
 <code> <code>
-.\no-OS\projects\project_name\+./no-OS/projects/project_name
 ├── builds.json ├── builds.json
 ├── Makefile ├── Makefile
Line 239: Line 243:
 </code> </code>
  
-<hidden Intel (Click to expand)> +<hidden Xilinx (Click to expand)> 
-Copy the **.sof** and **.sopcinfo** to the project folder and run:+Copy the **.xsa** to the project folder and run:
 <code> <code>
-.\no-OS\projects\adrv9009\+./no-OS/projects/adrv9009
 ├── Makefile ├── Makefile
 ├── profiles ├── profiles
 ├── src ├── src
 ├── src.mk ├── src.mk
-├── system_bd.sopcinfo +└── system_top.xsa
-└── adrv9009_a10gx.sof+
  
-make+make
 </code> </code>
 </hidden> </hidden>
  
-<hidden Xilinx (Click to expand)> +<hidden Maxim (Click to expand)> 
-Copy the **.hdf** to the project folder and run:+To build a project, type:
 <code> <code>
-.\no-OS\projects\adrv9009\ +$ make PLATFORM=maxim TARGET=...
-├── Makefile +
-├── profiles +
-├── src +
-├── src.mk +
-└── system_top.hdf +
- +
-> make+
 </code> </code>
 +The ''TARGET'' specifies the chip for which the project is built. If it is missing, ''max32660'' will be used. At the moment, the available targets are: ''max32650'', ''max32655'', ''max32660'', ''max32665'', ''max32670'', ''max32690'' and ''max78000''.  
 </hidden> </hidden>
  
 <hidden ADuCM3029 (Click to expand)> <hidden ADuCM3029 (Click to expand)>
-The ADuCM3029 projects also contain a ''pinmux_config.c'' file which contains pin configuration instructions. 
- 
 <code> <code>
-# build an ADuCM3029-only project +$ export PLATFORM=aducm3029 
-> make +make
- +
-# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM +
-make PLATFORM=aducm3029+
 </code> </code>
 </hidden> </hidden>
Line 289: Line 281:
 ├── bsp ├── bsp
 ├── obj ├── obj
-├── release.elf+├── project_name.elf
 └── tmp └── tmp
 </code> </code>
  
 +===== Running/Debugging =====
  
- +Once the ''.elf''''.hex'' or ''.bin'' 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.
-===== 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: Uploading the binary to target is generically achieved with:
Line 304: Line 294:
 </code> </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)> <hidden Xilinx (Click to expand)>
-Use the following command to launch XSDK to be able to debug graphically by clicking the debug button. <code> +For Xilinx project you can flash the board connected to a remote host. On the remote host make sure to start `hw_server`. 
-$ make develop+On your development environment run 
 +<code
 +$ export XSCT_REMOTE_HOST=<remote host ip> 
 +$ export XSCT_REMOTE_PORT=<remote host hw_server port
 +$ make run
 </code> </code>
  
-A debug configuration is created automatically, debugging should work out of the box.+By default the `hw_server` port should be 3121.
 </hidden> </hidden>
  
-<hidden ADuCM3029 (Click to expand)> +Use the following command to launch the SDK associated to the used platform in order to be able to debug graphically by clicking the debug button
-Use the following command to launch CCES to be able to debug graphically by clicking the debug button+
 <code> <code>
-$ make develop+$ make sdkopen
 </code> </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)> +Fore more details about the available make rules, [[resources:no-os:make|check out this page]]. 
-In order to run/debug on STM32 from command line, the makefile targets make use of the STM32CubeIDE modified version of **openocd** and a stock **arm-none-eabi-gdb**. Make sure you have them installed.+ 
 +++++  Running/Debugging in WSL | 
 + 
 +If you use WSL you can not test the boards on Linux because it does not support USB. If you will try to load the binary into the target with the command **make run**, you will encounter the following error:  
 +<note important> 
 +no targets found with "name =~ "APU*" && jtag_cable_name =~ "*$::jtagtarget*""available targets: none while executing 
 +"error "no targets found with \"$params(filter)\". available targets:$target_list""... 
 +</note> 
 + 
 +If you use WSL (Ubuntu) and want to connect to JTAG with a board, you have to switch the USB device from Windows to WSL. 
 +To do this, the following steps must be followed:
  
-Assuming you've installed the STM32CubeIDE to **/opt/stm32cubeide** directoryuse (and possibly adapt) the following commands:+   * It is recommended to have a version of Windows 10 or 11. 
 +   You must have all updates installed in WSL. 
 +       To be able to see the kernel version, the WSL version, and other features, in WSL (Ubuntuyou can enter the command:
 <code> <code>
-export OPENOCD_BIN=/opt/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.linux64_1.5.0.202011040924/tools/bin +:~uname -a 
-$ export OPENOCD_SCRIPTS=/opt/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.debug.openocd_1.5.0.202011091203/resources/openocd/st_scripts+Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
 </code> </code>
  
-Now you may run/debug with:+WSL should have a kernel version of 5.10.60.1 or later. You also need to run WSL2.Testing was done on version 22.4 of Ubuntu. 
 +   * You need to install the [[https://github.com/dorssel/usbipd-win/releases|usbipd-win]] project. Installation can be done manually, with a few clicks. 
 +   * You need to install from WSL, the user space tools for USB/IP and a database of USB hardware identifiers
 <code> <code>
-make PLATFORM=stm32 run +:~sudo apt upgrade 
-make PLATFORM=stm32 debug+:~sudo apt update 
 +:~$ sudo apt install linux-tools-virtual hwdata 
 +:~$ sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v ls /usr/lib/linux-tools/*/usbip | tail -n1) 20
 </code> </code>
-</hidden+ 
-</hidden>+If the last command does not work, try: 
 +<code> 
 +:~$ sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20 
 +</code> 
 + 
 +If there is a device connected to the USB port, it can be checked from the Device Manager. When connecting via JTAG, in Device Manager, the device will appear in the Universal serial Bus controllers section as USB Serial Converter. 
 + 
 +To attach the JTAG (or any USB device) from Windows to WSL we must do the following: 
 + 
 +   * Open Command Prompt in Administrator mode and enter the command: 
 +<code> 
 +C:\Windows\system32> usbipd wsl list 
 +BUSID  VID:PID    DEVICE                                                        STATE 
 +2-6    0c45:6732  Integrated Webcam, Integrated IR Webcam                       Not attached 
 +2-9    27c6:63ac  Goodix MOC Fingerprint                                        Not attached 
 +2-10   8087:0033  Intel(R) Wireless Bluetooth(R)                                Not attached 
 +5-4    0bda:8153  Realtek USB GbE Family Controller #2                          Not attached 
 +7-1    413c:4503  USB Input Device                                              Not attached 
 +7-2    413c:b080  Dell DA20 Adapter                                             Not attached 
 +9-5    413c:b06e  USB Input Device                                              Not attached 
 +10-1   0403:6014  USB Serial Converter                                          Not attached 
 +10-2   045e:0837  Microsoft Modern USB Headset, USB Input Device                Not attached 
 +10-3   04b4:0008  USB Serial Device (COM17)                                     Not attached 
 +10-5   413c:b06f  USB Input Device                                              Not attached 
 +</code> 
 +For this command, a list of all connected USB devices will be displayed in Windows, a brief description of them and their status: If they are/are not attached to the WSL instance. The JTAG appears in the cmd list but is not attached to a WSL instance. 
 + 
 +In WSL enter the following command: 
 +<code> 
 +:~$ lsusb 
 +Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
 +Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
 +</code> 
 +A list of all attached USB devices will be displayed here. At this moment we will only see roots hubs. 
 + 
 +   * To attach a USB device to WSL enter the following command in Command Prompt: 
 +<code> 
 +> usbipd wsl attach -b <BUSID> 
 +</code> 
 +BUSID represents the ID for the USB device for which we want to attach it in WSL. 
 +<code> 
 +> usbipd wsl attach -b 10-1 
 + 
 +C:\Windows\system32> usbipd wsl list 
 +BUSID  VID:PID    DEVICE                                                        STATE 
 +2-6    0c45:6732  Integrated Webcam, Integrated IR Webcam                       Not attached 
 +2-9    27c6:63ac  Goodix MOC Fingerprint                                        Not attached 
 +2-10   8087:0033  Intel(R) Wireless Bluetooth(R)                                Not attached 
 +5-4    0bda:8153  Realtek USB GbE Family Controller #2                          Not attached 
 +7-1    413c:4503  USB Input Device                                              Not attached 
 +7-2    413c:b080  Dell DA20 Adapter                                             Not attached 
 +9-5    413c:b06e  USB Input Device                                              Not attached 
 +10-1   0403:6014  USB Serial Converter                                          Attached - Ubuntu 
 +10-2   045e:0837  Microsoft Modern USB Headset, USB Input Device                Not attached 
 +10-3   04b4:0008  USB Serial Device (COM17)                                     Not attached 
 +10-5   413c:b06f  USB Input Device                                              Not attached 
 +</code> 
 +After running usbipd wsl list, it can be seen that the JTAG is now attached in WSL. 
 + 
 +In WSL if you run: **lsusb** we have: 
 +<code> 
 +Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
 +Bus 001 Device 005: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC 
 +Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\ 
 +</code> 
 +If Device Manager checks the USB device attached in WSL, it will no longer appear in the list of devices. 
 + 
 +   * If you want to return to the initial settings (the USB device must be attached to Windows): The USB device must be disconnected and connected to the computer or in Command Prompt, run the following command: 
 +<code> 
 +> usbipd wsl detach -b <BUSID> 
 +</code> 
 + 
 +For more information you can access the links: [[https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/|USB_devices_to_WSL]] , [[https://github.com/dorssel/usbipd-win/wiki/WSL-support#usbip-client-tools|USB/IP_client_tools]]  
 +++++
  
resources/no-os/build.1631695184.txt.gz · Last modified: 15 Sep 2021 10:39 by Ramona Alexandra Nechita