This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:no-os:build [02 Feb 2022 13:59] – [Building a project] George Mois | resources:no-os:build [06 Mar 2024 11:49] (current) – Run: add remote flash instruction for Xilinx platform Esteban Blanc | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | + | ====== | |
- | ====== | + | |
<note tip> | <note tip> | ||
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. | ||
+ | </ | ||
+ | |||
<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 Vitis is installed at this path: | + | Assuming the Vitis 2022.2 |
< | < | ||
Line 42: | Line 46: | ||
├── DocNav | ├── DocNav | ||
├── Downloads | ├── Downloads | ||
- | ├── SDK | ||
- | │ └── 2019.1 | ||
└── Vitis | └── Vitis | ||
- | └── | + | └── |
</ | </ | ||
Run: | Run: | ||
< | < | ||
- | $ source / | + | $ source / |
</ | </ | ||
- | |||
- | For more information, | ||
</ | </ | ||
Line 60: | Line 60: | ||
* Install [[https:// | * Install [[https:// | ||
* Install [[https:// | * Install [[https:// | ||
- | * Install '' | + | |
+ | | ||
+ | * 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 '' | ||
+ | </ | ||
+ | |||
+ | <hidden Maxim (Click to expand)> | ||
+ | * Install the [[maxim> | ||
+ | * Set the MAXIM_LIBRARIES environment variable to the MaximSDK/ | ||
+ | * For visual debugging and building, install '' | ||
+ | </ | ||
+ | |||
+ | <hidden Mbed (Click to expand)> | ||
+ | * Install Mbed CLI 1 as per guide here: [[https:// | ||
+ | * Configure the compiler location with Mbed CLI. This can be carried out by running the "mbed config -G GCC_ARM_PATH " | ||
+ | </ | ||
+ | |||
+ | <hidden Pico (Click to expand)> | ||
+ | * Clone the [[https:// | ||
+ | * Set the PICO_SDK_PATH environment variable to the pico-sdk cloned repository path. | ||
+ | * Install the [[https:// | ||
+ | * Set the JLINK_SERVER_PATH environment variable to the JLinkGDBServerCLExe path (the default path should be / | ||
+ | * For visual debugging and building, install '' | ||
</ | </ | ||
Line 76: | 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 '' |
- | └── 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: | + | </note> |
- | </ | + | |
- | </hidden> | + | |
<hidden Xilinx (Click to expand)> | <hidden Xilinx (Click to expand)> | ||
- | Assuming the Vitis is installed at this path: | + | Assuming the Vitis 2022.2 |
< | < | ||
C:\Xilinx | C:\Xilinx | ||
├── DocNav | ├── DocNav | ||
├── Downloads | ├── Downloads | ||
- | ├── SDK | ||
- | │ | ||
└── Vitis | └── Vitis | ||
- | └── | + | └── |
</ | </ | ||
Run: | Run: | ||
< | < | ||
- | > C:\Xilinx\Vitis\2021.1\settings64.bat | + | $ export PATH=/ |
</ | </ | ||
+ | </ | ||
- | For more information, | + | <hidden Maxim (Click to expand)> |
- | + | * Install | |
- | <note important> | + | * Set the MAXIM_LIBRARIES environment variable by running: '' |
- | 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 '' |
- | </ | + | |
- | + | ||
- | If this is the case, please manually add the following to your Windows PATH or install **make** for Windows of your choice: | + | |
- | < | + | |
- | C: | + | |
- | </ | + | |
</ | </ | ||
<hidden ADuCM3029 (Click to expand)> | <hidden ADuCM3029 (Click to expand)> | ||
- | | + | * Install the CrossCore Embedded Studio (refer to [[resources/ |
- | | + | |
* Manually Install '' | * Manually Install '' | ||
* Manually Install '' | * Manually Install '' | ||
+ | * Set the CCES_HOME environment variable to point to the CrossCore Embedded Studio installation directory: '' | ||
- | <note important> | ||
- | |||
- | 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 '' | ||
</ | </ | ||
- | |||
- | <note important> | ||
- | If using PowerShell instead of cmd, open another shell instance after running the above scripts. | ||
- | </ | ||
- | |||
</ | </ | ||
Line 168: | 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. |
< | < | ||
$ ls | $ ls | ||
- | Makefile | + | Makefile |
$ make | $ make | ||
- | # Alternatively you may select an .hdf file explicitly by: | + | # Alternatively you may select an .xsa file explicitly by: |
- | $ make HARDWARE=path/ | + | $ make HARDWARE=path/ |
+ | </ | ||
+ | </ | ||
+ | |||
+ | <hidden Maxim (Click to expand)> | ||
+ | To build a project, type: | ||
+ | < | ||
+ | make PLATFORM=maxim TARGET=... | ||
+ | </ | ||
+ | The '' | ||
+ | </ | ||
+ | |||
+ | <hidden Mbed (Click to expand)> | ||
+ | To build a project, type: | ||
+ | < | ||
+ | make PLATFORM=mbed | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <hidden Pico (Click to expand)> | ||
+ | To build a project, type: | ||
+ | < | ||
+ | make PLATFORM=pico | ||
</ | </ | ||
</ | </ | ||
Line 183: | Line 204: | ||
Make sure you have the .ioc file in the project directory, then type: | Make sure you have the .ioc file in the project directory, then type: | ||
< | < | ||
- | $ make | + | $ make PLATFORM=stm32 |
</ | </ | ||
+ | |||
+ | If during the project generation you get a dialog saying that you are using an .ioc file generated with an old CubeMX version, click '' | ||
+ | |||
+ | 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 '' | ||
</ | </ | ||
Line 203: | 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. | + | |
</ | </ | ||
< | < | ||
- | > cd .\no-OS\projects\project_name\ | + | $ cd no-OS/projects/project_name |
</ | </ | ||
It should contain make-related files and source files: | It should contain make-related files and source files: | ||
< | < | ||
- | .\no-OS\projects\project_name\ | + | ./no-OS/projects/project_name |
├── builds.json | ├── builds.json | ||
├── Makefile | ├── Makefile | ||
Line 220: | Line 243: | ||
</ | </ | ||
- | < | + | < |
- | Copy the **.sof** and **.sopcinfo** to the project folder and run: | + | Copy the **.xsa** to the project folder and run: |
< | < | ||
- | .\no-OS\projects\adrv9009\ | + | ./no-OS/projects/adrv9009 |
├── Makefile | ├── Makefile | ||
├── profiles | ├── profiles | ||
├── src | ├── src | ||
├── src.mk | ├── src.mk | ||
- | ├── system_bd.sopcinfo | + | └── |
- | └── | + | |
- | > make | + | $ make |
</ | </ | ||
</ | </ | ||
- | < | + | < |
- | Copy the **.hdf** to the project | + | To build a project, type: |
< | < | ||
- | .\no-OS\projects\adrv9009\ | + | $ make PLATFORM=maxim TARGET=... |
- | ├── Makefile | + | |
- | ├── profiles | + | |
- | ├── src | + | |
- | ├── src.mk | + | |
- | └── system_top.hdf | + | |
- | + | ||
- | > make | + | |
</ | </ | ||
+ | The '' | ||
</ | </ | ||
<hidden ADuCM3029 (Click to expand)> | <hidden ADuCM3029 (Click to expand)> | ||
- | The ADuCM3029 projects also contain a '' | ||
- | |||
< | < | ||
- | # build an ADuCM3029-only project | + | $ export |
- | > make | + | $ make |
- | + | ||
- | # if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM | + | |
- | > make PLATFORM=aducm3029 | + | |
</ | </ | ||
</ | </ | ||
Line 270: | Line 281: | ||
├── bsp | ├── bsp | ||
├── obj | ├── obj | ||
- | ├── | + | ├── |
└── tmp | └── tmp | ||
</ | </ | ||
- | |||
- | Further information on the build process can be found [[resources: | ||
===== Running/ | ===== Running/ | ||
- | Once the '' | + | Once the '' |
Uploading the binary to target is generically achieved with: | Uploading the binary to target is generically achieved with: | ||
Line 284: | Line 293: | ||
$ make run | $ make run | ||
</ | </ | ||
+ | |||
+ | <hidden Xilinx (Click to expand)> | ||
+ | For Xilinx project you can flash the board connected to a remote host. On the remote host make sure to start `hw_server`. | ||
+ | On your development environment run | ||
+ | < | ||
+ | $ export XSCT_REMOTE_HOST=< | ||
+ | $ export XSCT_REMOTE_PORT=< | ||
+ | $ make run | ||
+ | </ | ||
+ | |||
+ | By default the `hw_server` port should be 3121. | ||
+ | </ | ||
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 the SDK associated to the used platform in order to be able to debug graphically by clicking the debug button: | ||
Line 289: | Line 310: | ||
$ make sdkopen | $ make sdkopen | ||
</ | </ | ||
+ | |||
+ | Fore more details about the available make rules, [[resources: | ||
+ | |||
+ | ++++ Running/ | ||
+ | |||
+ | 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 =~ " | ||
+ | "error "no targets found with \" | ||
+ | </ | ||
+ | |||
+ | 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: | ||
+ | |||
+ | * 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 (Ubuntu) you can enter the command: | ||
+ | < | ||
+ | :~$ uname -a | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | 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:// | ||
+ | * You need to install from WSL, the user space tools for USB/IP and a database of USB hardware identifiers: | ||
+ | < | ||
+ | :~$ sudo apt upgrade | ||
+ | :~$ sudo apt update | ||
+ | :~$ sudo apt install linux-tools-virtual hwdata | ||
+ | :~$ sudo update-alternatives --install / | ||
+ | </ | ||
+ | |||
+ | If the last command does not work, try: | ||
+ | < | ||
+ | :~$ sudo update-alternatives --install / | ||
+ | </ | ||
+ | |||
+ | 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: | ||
+ | < | ||
+ | C: | ||
+ | BUSID VID: | ||
+ | 2-6 0c45: | ||
+ | 2-9 27c6: | ||
+ | 2-10 | ||
+ | 5-4 0bda: | ||
+ | 7-1 413c: | ||
+ | 7-2 413c: | ||
+ | 9-5 413c: | ||
+ | 10-1 | ||
+ | 10-2 | ||
+ | 10-3 | ||
+ | 10-5 | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | :~$ 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 | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | > usbipd wsl attach -b < | ||
+ | </ | ||
+ | BUSID represents the ID for the USB device for which we want to attach it in WSL. | ||
+ | < | ||
+ | > usbipd wsl attach -b 10-1 | ||
+ | |||
+ | C: | ||
+ | BUSID VID: | ||
+ | 2-6 0c45: | ||
+ | 2-9 27c6: | ||
+ | 2-10 | ||
+ | 5-4 0bda: | ||
+ | 7-1 413c: | ||
+ | 7-2 413c: | ||
+ | 9-5 413c: | ||
+ | 10-1 | ||
+ | 10-2 | ||
+ | 10-3 | ||
+ | 10-5 | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub | ||
+ | Bus 001 Device 005: ID 0403:6014 Future Technology Devices International, | ||
+ | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\ | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | > usbipd wsl detach -b < | ||
+ | </ | ||
+ | |||
+ | For more information you can access the links: [[https:// | ||
+ | ++++ | ||