diff --git a/quickstart/_images/zynq7000-zturn-connections.jpg b/quickstart/_images/zynq7000-zturn-connections.jpg new file mode 100755 index 00000000..f77e5109 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-connections.jpg differ diff --git a/quickstart/_images/zynq7000-zturn-flash-boot.jpg b/quickstart/_images/zynq7000-zturn-flash-boot.jpg new file mode 100755 index 00000000..2008f374 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-flash-boot.jpg differ diff --git a/quickstart/_images/zynq7000-zturn-ls.png b/quickstart/_images/zynq7000-zturn-ls.png new file mode 100644 index 00000000..af36b4d0 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-ls.png differ diff --git a/quickstart/_images/zynq7000-zturn-magic.png b/quickstart/_images/zynq7000-zturn-magic.png new file mode 100644 index 00000000..e37ee971 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-magic.png differ diff --git a/quickstart/_images/zynq7000-zturn-picocom.png b/quickstart/_images/zynq7000-zturn-picocom.png new file mode 100644 index 00000000..2a9ed2e4 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-picocom.png differ diff --git a/quickstart/_images/zynq7000-zturn-plo-erase.png b/quickstart/_images/zynq7000-zturn-plo-erase.png new file mode 100644 index 00000000..1a2dcfac Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-plo-erase.png differ diff --git a/quickstart/_images/zynq7000-zturn-plo.png b/quickstart/_images/zynq7000-zturn-plo.png new file mode 100644 index 00000000..2f6c65f6 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-plo.png differ diff --git a/quickstart/_images/zynq7000-zturn-psh.png b/quickstart/_images/zynq7000-zturn-psh.png new file mode 100644 index 00000000..8270c727 Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-psh.png differ diff --git a/quickstart/_images/zynq7000-zturn-sd-boot.jpg b/quickstart/_images/zynq7000-zturn-sd-boot.jpg new file mode 100755 index 00000000..76c9903e Binary files /dev/null and b/quickstart/_images/zynq7000-zturn-sd-boot.jpg differ diff --git a/quickstart/armv7a9-zynq7000-qemu.md b/quickstart/armv7a9-zynq7000-qemu.md index 44ef0d3d..995f411d 100644 --- a/quickstart/armv7a9-zynq7000-qemu.md +++ b/quickstart/armv7a9-zynq7000-qemu.md @@ -128,6 +128,7 @@ If you want to quit, you should click on the terminal window, press `ctrl + a`, ## See also 1. [Running system on armv7a9-zynq7000](armv7a9-zynq7000.md) -2. [Running system on armv7a9-zynq7000 on development board](armv7a9-zynq7000-zedboard.md) -3. [Running system on targets](README.md) -4. [Table of Contents](../README.md) +2. [Running system on armv7a9-zynq7000-zedboard](armv7a9-zynq7000-zedboard.md) +3. [Running system on armv7a9-zynq7000-zturn](armv7a9-zynq7000-zturn.md) +4. [Running system on targets](README.md) +5. [Table of Contents](../README.md) diff --git a/quickstart/armv7a9-zynq7000-zedboard.md b/quickstart/armv7a9-zynq7000-zedboard.md index 1a9e0380..dfed755e 100644 --- a/quickstart/armv7a9-zynq7000-zedboard.md +++ b/quickstart/armv7a9-zynq7000-zedboard.md @@ -232,5 +232,6 @@ top 1. [Running system on armv7a9-zynq7000](armv7a9-zynq7000.md) 2. [Running system on armv7a9-zynq7000 on emulator](armv7a9-zynq7000-qemu.md) -3. [Running system on targets](README.md) -4. [Table of Contents](../README.md) +3. [Running system on armv7a9-zynq7000-zturn](armv7a9-zynq7000-zturn.md) +4. [Running system on targets](README.md) +5. [Table of Contents](../README.md) diff --git a/quickstart/armv7a9-zynq7000-zturn.md b/quickstart/armv7a9-zynq7000-zturn.md new file mode 100644 index 00000000..4d95ee02 --- /dev/null +++ b/quickstart/armv7a9-zynq7000-zturn.md @@ -0,0 +1,242 @@ +# Running system on `armv7a9-zynq7000-zturn` (Xilinx Zynq-7000, Zturn development board) + +These instructions describe how to run a Phoenix-RTOS system image for `armv7a9-zynq7000-zturn` target architecture. +Note that, the build artifacts, including the system image, should be first provided in the `_boot` directory. +If you haven't run the `build.sh` script yet, run it for `armv7a9-zynq7000-zturn` target. + +See [how to build the Phoenix-RTOS system image](../building/README.md). + +## Preparing the board + +Preparing the board depends on how the plo is loaded into RAM, this quickstart describes 2 approaches - loading from SD +card and NAND flash, use one of them depending on your needs. For example if you have empty flash memory or want to +load new plo use SD card, otherwise you can simply load plo from NAND flash. + +### Loading plo from SD card + +- Firstly, you should copy the disk image `phoenix.disk` from the `_boot/armv7a9-zynq7000-zturn` directory to the SD + card and rename it to `BOOT.bin`, make sure that this file is in binary format, otherwise you won't be able to load + plo (Phoenix-RTOS Loader) from SD card to RAM. + +- Then, insert the SD card into the board. + +- To allow loading from SD card, set the jumpers (`JP1`, `JP2`) to the following configuration: + + + +### Loading plo from NAND flash + +**This version is possible only if you have already flashed Phoenix-RTOS system image to this board before!** + +- To allow load from NAND flash, set the jumpers to the following configuration: + + + +### Loading plo - common steps + +- To communicate with the board you will need to connect the USB cable to the `USB_UART` port (`J6`). + +- You should also connect another micro USB cable to the `USB_OTG` port (`J2`). + + The picture below presents how the board should be connected: + + + +- If you connected everything like in the picture above, the board should be powered on and the `D25` POWER LED should + shine blue. + +- Now you should verify, what USB device on your host-pc is connected with the `UART` (console). To check that run: + + ```bash + ls -l /dev/serial/by-id + ``` + + + + If your output is like in the screenshot above, the console (`UART` in the evaluation board) is on the `USB0` port. + +- When the board is connected to your host-pc, open serial port in terminal using picocom and type the console port + (in this case USB0) + + ```bash + picocom -b 115200 --imap lfcrlf /dev/ttyUSB0 + ``` + +- You should see such output: + + + +
+ How to get picocom (Ubuntu 20.04) + + ```bash + sudo apt-get update && \ + sudo apt-get install picocom + ``` + + To use picocom without sudo privileges run this command and then restart: + + ```bash + sudo usermod -a -G tty + ``` + +
+
+ +You can leave the terminal with the serial port open, and follow the next steps. + +## Flashing the Phoenix-RTOS system image + +At first before any flashing, you need to enter Phoenix-RTOS loader (plo). + +### Entering Phoenix-RTOS loader (plo) + +Press RESET button (`K2`) to restart the chip. + +If flash memory doesn't contain PHOENIX-RTOS system image, booting process will stop at plo level, you should see: + + + +Phoenix-RTOS loader tried to find an image in flash, which was unsuccessful. That's why there is an error message. + +Otherwise, in order to get into plo you need to press any key within 500ms. If you don't do that, plo will load system +and start psh, but we cannot flash from there. Output when you enter psh: + + + +Restart the chip with RESTART button `K2` and try again. Output of successful entry to plo: + + + +If you want to flash the system image please follow the next steps. + +### Copying image to flash memory using PHFS (phoenixd) + +To flash the disk image, first, you need to verify on which port plo USB device has appeared. You can check that using +`ls` as follow: + +```bash +ls -l /dev/serial/by-id +``` + + + +To share disk image to the bootloader, `phoenixd` has to be launched with the following arguments (choose suitable +ttyACMx device, in this case, ttyACM0): + +```bash +cd _boot/armv7a9-zynq7000-zturn +``` + +```bash +sudo ./phoenixd -p /dev/ttyACM0 -b 115200 -s . +``` + + + +Before flashing, good practise is to erase older file system on flash memory (this is done to avoid errors). + +### Erasing the area intended for file system + +It's needed to erase sectors that will be used by `jffs2` file system as we place in the `phoenix.disk` + only the necessary file system content, not the whole area intended for it. +Without erasure `jffs2` may encounter data from the previous flash operation and errors + during the system startup may occur. +That's why we have run erase using plo command specific to `jffs2` file system: + +```plaintext +jffs2 -d 2.0 -e -c 0x400:0x400:0x2000:16 +``` + +Quick description of used arguments: + +- `-d 2.0` - regards to the device with the following ID: 2.0, which means it's a flash memory (2) instance nr 0 (0), + +- `-e` - erase, + +- `-c 0x80:0x100:0x10000:16` - set clean markers + - start block: `0x400` (`FS_OFFS`/`BLOCK_SIZE`), + - number of blocks: `0x400` (`FS_SZ`/`BLOCK_SIZE`), + - block size: `0x2000` (`erase_size`) + - clean marker size: `16` + + + +Please wait until erasing is finished. + +To start copying the file, write the following command in the console with plo interface: + +```bash +copy usb0 phoenix.disk flash0 0x0 0x0 +``` + + + +### Booting Phoenix-RTOS from NAND flash memory + +Now, the image is located in the NAND Flash memory. +To run it you should follow the steps below: + +- Power off the board by disconnecting USB_OTG and USB_UART connectors + +- Configure jumpers as depicted (`JP2:ON`, `JP1:OFF`): + + + +- Power on the board by connecting USB_OTG and USB_UART connectors + +- Check which port the console appeared on: + + ```bash + ls -l /dev/serial/by-id/ + ``` + + + +- connect to that port: + + ```bash + picocom -b 115200 --imap lfcrlf /dev/ttyACM0 + ``` + +- restart the chip using the `K2` RESET button, after that booting starts + +- after successful boot you should see: + + + +Psh prompt indicates that everything is up and running. + +## Using Phoenix-RTOS + +To get the available command list please type: + +```bash +help +``` + + + +If you want to get the list of working processes please type: + +```bash +ps +``` + + + +To get the table of processes please type: + +```bash +top +``` + + + +## See also + +1. [Running system on armv7a9-zynq7000](armv7a9-zynq7000.md) +2. [Running system on armv7a9-zynq7000 on emulator](armv7a9-zynq7000-qemu.md) +3. [Running system on armv7a9-zynq7000 on development board](armv7a9-zynq7000-zedboard.md) +4. [Running system on targets](README.md) +5. [Table of Contents](../README.md) diff --git a/quickstart/armv7a9-zynq7000.md b/quickstart/armv7a9-zynq7000.md index e0a65069..c92a6ea5 100644 --- a/quickstart/armv7a9-zynq7000.md +++ b/quickstart/armv7a9-zynq7000.md @@ -4,11 +4,17 @@ This version is designed for Xilinx Zynq-7000 SoC (System on Chip) with ARM Cort ## Development board or emulator -The easiest way to start programming hardware targets using Phoenix-RTOS is to get some of the evaluation boards with a specified target processor or microcontroller. In this case [ZedBoard](https://www.xilinx.com/products/boards-and-kits/1-8dyf-11.html) is the example of a board with the `zynq7000` SoC, where the default configuration of peripherals allows to run Phoenix-RTOS. -The next steps for a development board are described below. +The easiest way to start programming hardware targets using Phoenix-RTOS is to get some of the evaluation +boards with a specified target processor or microcontroller. There are 2 supported boards +[ZedBoard](https://www.xilinx.com/products/boards-and-kits/1-8dyf-11.html) +and [Zturn](https://www.myirtech.com/list.asp?id=502) with the `zynq7000` SoC, where the default +configuration of peripherals allows to run Phoenix-RTOS. +The next steps for particular development board are described below. - [Running system on `armv7a9-zynq7000-zedboard`](armv7a9-zynq7000-zedboard.md) +- [Running system on `armv7a9-zynq7000-zturn`](armv7a9-zynq7000-zturn.md) + If you don't have one, you can check the running system for this target architecture on an emulator and follow the steps from the site below. - [Running system on `armv7a9-zynq7000-qemu`](armv7a9-zynq7000-qemu.md)