This shows you the differences between two versions of the page.
Previous revisionLast revision | |||
— | resources:tools-software:linuxdsp:docs:quickstartguide:quickstart_sc584_2_2_0 [24 Nov 2022 14:10] – Vasileios Bimpikas | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Yocto Linux 2.2.0 Quickstart Guide for ADSP-SC584 ===== | ||
+ | <note important> | ||
+ | <note important> | ||
+ | ===== Setting Up Your Host PC ===== | ||
+ | The build system is currently supported on host PCs running Ubuntu 20.04 LTS 64-bit. | ||
+ | |||
+ | \\ | ||
+ | ==== Installing Required Packages ==== | ||
+ | In order to build and deploy Linux to your ADSP-SC584-EZKIT development board you will need to install the following packages on your host PC. | ||
+ | |||
+ | < | ||
+ | $ sudo apt-get update | ||
+ | $ sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm u-boot-tools openssl curl tftpd-hpa python | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | ==== Installing CrossCore Embedded Studio ==== | ||
+ | CrossCore Embedded Studio contains OpenOCD which is used to transfer U-Boot into RAM for the first initial boot of the device. | ||
+ | |||
+ | < | ||
+ | $ wget https:// | ||
+ | $ sudo dpkg -i ./ | ||
+ | $ sudo apt install lib32z1 | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ==== Configuring TFTP Service==== | ||
+ | A TFTP server on the host is used to transfer images to the development board. | ||
+ | Install and configure. | ||
+ | |||
+ | < | ||
+ | $ sudo vi / | ||
+ | |||
+ | #Replace the existing file with the following | ||
+ | TFTP_USERNAME=" | ||
+ | TFTP_DIRECTORY="/ | ||
+ | TFTP_ADDRESS=" | ||
+ | TFTP_OPTIONS=" | ||
+ | #End of File | ||
+ | |||
+ | $ sudo mkdir /tftpboot | ||
+ | $ sudo chmod 777 /tftpboot | ||
+ | $ sudo service tftpd-hpa restart | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ==== Configure Minicom ==== | ||
+ | In order to communicate with the U-Boot bootloader, a UART connection must be made between the host PC and the development board. It is recommended that you use minicom to do this. Minicom must be configured to connect to U-Boot correctly. | ||
+ | |||
+ | On the host PC open a terminal and execute the following commands: | ||
+ | |||
+ | < | ||
+ | $ sudo apt-get install -y minicom | ||
+ | $ sudo minicom -s | ||
+ | |||
+ | +-----[configuration]------+ | ||
+ | | Filenames and paths | | ||
+ | | File transfer protocols | ||
+ | | Serial port setup | | ||
+ | | Modem and dialing | ||
+ | | Screen and keyboard | ||
+ | | Save setup as dfl | | ||
+ | | Save setup as.. | | ||
+ | | Exit | | ||
+ | | Exit from Minicom | ||
+ | +--------------------------+ | ||
+ | |||
+ | |||
+ | # Select Serial port setup | ||
+ | Set Serial Device to / | ||
+ | Set Bps/ | ||
+ | Set Hardware Flow Control to No | ||
+ | |||
+ | Close the Serial port setup option by press Esc | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ==== Installing the Sources ==== | ||
+ | The example is fully contained in the Analog Devices Yocto Linux github repositories. | ||
+ | |||
+ | To install the sources: | ||
+ | <wrap hide> | ||
+ | < | ||
+ | $ mkdir ~/lnxdsp | ||
+ | $ cd ~/lnxdsp | ||
+ | $ mkdir bin | ||
+ | $ curl http:// | ||
+ | $ chmod a+x ./bin/repo | ||
+ | $ ./bin/repo init \ | ||
+ | -u https:// | ||
+ | -b release/ | ||
+ | -m release-yocto-2.1.0.xml | ||
+ | $ ./bin/repo sync | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ===== Building the Image ===== | ||
+ | ==== Preparing the buildtool ==== | ||
+ | Yocto requires the environment to be configured before building is possible. | ||
+ | Source the setup script for your board: | ||
+ | < | ||
+ | $ source setup-environment -m adsp-sc584-ezkit | ||
+ | </ | ||
+ | |||
+ | Sourcing the script will configure your build environment and create a build folder along with a local build configuration file. See the Yocto Manual for further details. | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | \\ | ||
+ | ==== Building the example ==== | ||
+ | You can build three different versions of the root filesystem; minimal, ramdisk and full. | ||
+ | To build the example images invoke bitbake from within the build directory created previously. | ||
+ | |||
+ | < | ||
+ | $ bitbake adsp-sc5xx-minimal | ||
+ | $ bitbake adsp-sc5xx-ramdisk | ||
+ | $ bitbake adsp-sc5xx-full | ||
+ | </ | ||
+ | |||
+ | When the build completes you will see a warning that the ELF binary has relocations in .text. It is OK to ignore this warning | ||
+ | |||
+ | ==== Running U-Boot on the Board for the first time==== | ||
+ | |||
+ | |||
+ | Copy the U-Boot & the init binary files to the /tftpboot directory, so that U-Boot can be ran from the board' | ||
+ | |||
+ | < | ||
+ | $ cp tmp/ | ||
+ | $ cp tmp/ | ||
+ | $ cp tmp/ | ||
+ | </ | ||
+ | |||
+ | Before installing the software on to the development board, ensure that the following cables are connected: | ||
+ | * Board connected to network via ethernet cable using J13 connector. | ||
+ | * Board connected to host PC using USB micro cable, connected to USB/UART port on the development board | ||
+ | * Board connected to the ICE 1000 or ICE 2000 via the DEBUG port on the board | ||
+ | * ICE is also connected to host PC via USB mini cable | ||
+ | |||
+ | {{: | ||
+ | |||
+ | * The BOOT MODE selector on the EV-SC584-SOM board should be turned to " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The console output from U-Boot and later on Linux will appear on the USB serial port configured in minicom earlier so open up minicom. | ||
+ | ;'' | ||
+ | :< | ||
+ | | ||
+ | In a separate console launch OpenOCD and connect to the development board. | ||
+ | |||
+ | |||
+ | ;'' | ||
+ | :< | ||
+ | $ cd / | ||
+ | $ sudo / | ||
+ | Where ''< | ||
+ | When successful you should see a message similar to the console output below | ||
+ | < | ||
+ | Open On-Chip Debugger (Analog Devices CCES 2.10.0 OpenOCD 0.9.0-ge8d0a22) 0.9.0 | ||
+ | Licensed under GNU GPL v2 | ||
+ | Report bugs to < | ||
+ | adapter speed: 1000 kHz | ||
+ | Info : transports supported by the debug adapter: " | ||
+ | Info : auto-select transport " | ||
+ | halt and restart using CTI | ||
+ | trst_only separate trst_push_pull | ||
+ | adspsc58x_init | ||
+ | Info : ICE-1000 firmware version is 1.0.2 | ||
+ | Info : clock speed 1000 kHz | ||
+ | Info : JTAG tap: adspsc584.adjc tap/device found: 0x428080cb (mfg: 0x065, part: 0x2808, ver: 0x4) | ||
+ | Info : JTAG tap: adspsc584.dap enabled | ||
+ | Info : adspsc584.dap: | ||
+ | Info : adspsc584.dap: | ||
+ | </ | ||
+ | |||
+ | In a third console window launch GDB and type '' | ||
+ | |||
+ | ;'' | ||
+ | : < | ||
+ | $ cd /tftpboot | ||
+ | $ / | ||
+ | ... | ||
+ | (gdb) target extended-remote :3333 | ||
+ | Remote debugging using :3333 | ||
+ | 0x00004884 in ?? () | ||
+ | (gdb) load init-sc584-ezkit.elf | ||
+ | Loading section .text, size 0x744 lma 0x20080000 | ||
+ | Start address 0x20080028, load size 1860 | ||
+ | Transfer rate: 22 KB/sec, 1860 bytes/ | ||
+ | (gdb) c | ||
+ | Continuing. | ||
+ | ^C | ||
+ | Program received signal SIGINT, Interrupt. | ||
+ | 0x20080024 in ?? () | ||
+ | </ | ||
+ | |||
+ | Now, load U-Boot into RAM. | ||
+ | |||
+ | ;'' | ||
+ | : | ||
+ | < | ||
+ | (gdb) load | ||
+ | Loading section .text, size 0x3a8 lma 0x89200000 | ||
+ | Loading section .efi_runtime, | ||
+ | Loading section .text_rest, size 0x4dd10 lma 0x892011e0 | ||
+ | Loading section .rodata, size 0xfbe0 lma 0x8924eef0 | ||
+ | Loading section .hash, size 0x18 lma 0x8925ead0 | ||
+ | Loading section .dtb.init.rodata, | ||
+ | Loading section .data, size 0x3468 lma 0x8925ee50 | ||
+ | Loading section .got.plt, size 0xc lma 0x892622b8 | ||
+ | Loading section .u_boot_list, | ||
+ | Loading section .efi_runtime_rel, | ||
+ | Loading section .rel.dyn, size 0xb180 lma 0x89263214 | ||
+ | Loading section .dynsym, size 0x30 lma 0x8926e394 | ||
+ | Loading section .dynstr, size 0x1 lma 0x8926e3c4 | ||
+ | Loading section .dynamic, size 0x90 lma 0x8926e3c8 | ||
+ | Loading section .gnu.hash, size 0x18 lma 0x8926e458 | ||
+ | Start address 0x89200000, load size 451677 | ||
+ | Transfer rate: 31 KB/sec, 11581 bytes/ | ||
+ | (gdb) c | ||
+ | Continuing. | ||
+ | </ | ||
+ | |||
+ | At this point U-Boot will now be running in RAM on your target board. You should see U-Boot booting in the minicom console (Terminal 1). Press a key to interrupt the boot process before the countdown terminates: | ||
+ | ;'' | ||
+ | : < | ||
+ | U-Boot 2020.10 (Aug 23 2022 - 13:09:23 +0000) | ||
+ | |||
+ | CPU: ADSP ADSP-SC584-0.1 (Detected Rev: 1.1) (spi flash boot) | ||
+ | VCO: 450 MHz, Cclk0: 450 MHz, Sclk0: 112.500 MHz, Sclk1: 112.500 MHz, DCLK: 225 MHz | ||
+ | OCLK: 150 MHz | ||
+ | Model: ADI sc584-ezkit | ||
+ | I2C: ready | ||
+ | DRAM: 112 MiB | ||
+ | MMC: | ||
+ | Loading Environment from SPIFlash... | ||
+ | SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB | ||
+ | OK | ||
+ | In: serial@0x31003000 | ||
+ | Out: | ||
+ | Err: | ||
+ | other init | ||
+ | Net: | ||
+ | Hit any key to stop autoboot: | ||
+ | => | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | == Flash U-Boot to SPI Flash == | ||
+ | |||
+ | \\ | ||
+ | In the U-Boot console, set the IP address of the Host Linux PC that hosts the U-Boot loader file ('' | ||
+ | ;'' | ||
+ | : | ||
+ | < | ||
+ | => setenv serverip < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | If your network **supports** DHCP, run: | ||
+ | < | ||
+ | => dhcp | ||
+ | </ | ||
+ | |||
+ | If your network **does NOT support** DHCP, run: | ||
+ | < | ||
+ | => set ipaddr < | ||
+ | </ | ||
+ | |||
+ | Where ''< | ||
+ | |||
+ | Next, run the U-Boot update command to copy the U-Boot loader file from the host PC to the target board, and write it into flash: | ||
+ | < | ||
+ | => run update | ||
+ | </ | ||
+ | |||
+ | You will see an output similar to the one below: | ||
+ | < | ||
+ | => run update | ||
+ | Speed: 100, full duplex | ||
+ | Using dwmac.3100c000 device | ||
+ | TFTP from server 10.37.33.116; | ||
+ | Filename ' | ||
+ | Load address: 0x89000000 | ||
+ | Loading: ############################### | ||
+ | 2.2 MiB/s | ||
+ | done | ||
+ | Bytes transferred = 453828 (6ecc4 hex) | ||
+ | SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB | ||
+ | SF: 524288 bytes @ 0x0 Erased: OK | ||
+ | device 0 offset 0x0, size 0x6ecc4 | ||
+ | SF: 453828 bytes @ 0x0 Written: OK | ||
+ | => | ||
+ | </ | ||
+ | |||
+ | At this point the U-Boot binary is stored in flash. You can now disconnect the ICE-1000 or ICE-2000 from the development board and make sure to switch the BMODE to position 1. You will only need to reconnect this if your board fails to boot and you need to re-follow these instructions. | ||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | ==== Booting Linux Using TFTP ==== | ||
+ | In order to boot Linux, the TFTP server should be setup as [[resources/ | ||
+ | |||
+ | < | ||
+ | $ cp tmp/ | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | === RAM Boot === | ||
+ | For RAM boot a copy of the image containing the filesystem needs copied to the /tftpboot directory. | ||
+ | < | ||
+ | $ cp tmp/ | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | === NFS Boot === | ||
+ | For NFS boot we use the Network File System which is stored in local Ubuntu Host. This is suggested when you do application development. To setup the NFS server: | ||
+ | < | ||
+ | $ sudo apt-get install nfs-kernel-server | ||
+ | $ sudo vi / | ||
+ | |||
+ | #Add following commands | ||
+ | /romfs *(rw, | ||
+ | |||
+ | $ sudo mkdir /romfs/ | ||
+ | $ sudo chmod 777 /romfs/ | ||
+ | $ sudo service nfs-kernel-server start | ||
+ | </ | ||
+ | The root filesystem should then be copied to /romfs. | ||
+ | < | ||
+ | $ sudo tar -xf tmp/ | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | === Booting into Linux from TFTP === | ||
+ | Next, on the target, from u-boot, run one of the following command: | ||
+ | < | ||
+ | => run ramboot | ||
+ | or | ||
+ | => run nfsboot | ||
+ | ...... | ||
+ | ...... | ||
+ | | ||
+ | [ OK ] Started Update UTMP about System Runlevel Changes. | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Analog Devices Yocto Distribution | ||
+ | | ||
+ | www.yoctoproject.org | ||
+ | |||
+ | adsp-sc584-ezkit login: root | ||
+ | Password: adi | ||
+ | root@adsp-sc584-ezkit: | ||
+ | </ | ||
+ | |||
+ | The username is **root** and the password is **adi**. | ||
+ | |||
+ | \\ | ||
+ | ==== Building the SDK ==== | ||
+ | To build the SDK follow the instructions here [[: |