|
| 1 | +================ |
| 2 | +PINE64 StarPro64 |
| 3 | +================ |
| 4 | + |
| 5 | +`PINE64 StarPro64 <https://lupyuen.github.io/articles/starpro64>`_ |
| 6 | +is a RISC-V Single-Board Computer based on the ESWIN EIC7700X RISC-V SoC |
| 7 | +with Quad-Core 64-bit RISC-V CPU, 32 GB LPDDR5 RAM and 100 Mbps Ethernet. |
| 8 | + |
| 9 | +Features |
| 10 | +======== |
| 11 | + |
| 12 | +- **System on Chip:** ESWIN EIC7700X |
| 13 | +- **Processors:** 4 x RV64GC 1.4 GHz 64-bit RISC-V Cores |
| 14 | +- **NPU:** 19.95 TOPS INT8 |
| 15 | +- **Memory:** 32 GB 64-bit LPDDR5 |
| 16 | +- **Storage:** 1 x microSD Connector, 1 x eMMC Pad |
| 17 | +- **Network:** 2 x GMAC, RGMII supported |
| 18 | +- **PCI Express:** 4-lane PCIe 3.0 (RC + EP) |
| 19 | +- **Wireless:** WiFi, Bluetooth |
| 20 | +- **USB:** USB 2.0 and 3.0 |
| 21 | +- **GPIO:** Full GPIO Header |
| 22 | + |
| 23 | +Serial Console |
| 24 | +============== |
| 25 | + |
| 26 | +A **USB Serial Adapter** (CH340 or CP2102) is required to run NuttX |
| 27 | +on StarPro64. |
| 28 | + |
| 29 | +Connect the USB Serial Adapter to StarPro64 Serial Console at: |
| 30 | + |
| 31 | +========== ================= |
| 32 | +USB Serial StarPro64 Pin |
| 33 | +========== ================= |
| 34 | +GND Pin 6 (GND) |
| 35 | +RX Pin 8 (UART0 TX) |
| 36 | +TX Pin 10 (UART0 RX) |
| 37 | +========== ================= |
| 38 | + |
| 39 | +On the USB Serial Adapter, set the **Voltage Level** to 3V3. |
| 40 | + |
| 41 | +Connect StarPro64 to our computer with the USB Serial Adapter. |
| 42 | +On our computer, start a Serial Terminal and connect to the USB Serial Port |
| 43 | +at **115.2 kbps**: |
| 44 | + |
| 45 | +.. code:: console |
| 46 | +
|
| 47 | + $ screen /dev/ttyUSB0 115200 |
| 48 | +
|
| 49 | +NuttX will appear in the Serial Console when it boots on StarPro64. |
| 50 | + |
| 51 | +RISC-V Toolchain |
| 52 | +================ |
| 53 | + |
| 54 | +Before building NuttX for StarPro64, download the toolchain for |
| 55 | +`xPack GNU RISC-V Embedded GCC (riscv-none-elf) <https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases>`_. |
| 56 | + |
| 57 | +Add the downloaded toolchain ``xpack-riscv-none-elf-gcc-.../bin`` |
| 58 | +to the ``PATH`` Environment Variable. |
| 59 | + |
| 60 | +Check the RISC-V Toolchain: |
| 61 | + |
| 62 | +.. code:: console |
| 63 | +
|
| 64 | + $ riscv-none-elf-gcc -v |
| 65 | +
|
| 66 | +Building |
| 67 | +======== |
| 68 | + |
| 69 | +To build NuttX for StarPro64, :doc:`install the prerequisites </quickstart/install>` and |
| 70 | +:doc:`clone the git repositories </quickstart/install>` for ``nuttx`` and ``apps``. |
| 71 | + |
| 72 | +Configure the NuttX project and build the project: |
| 73 | + |
| 74 | +.. code:: console |
| 75 | +
|
| 76 | + $ cd nuttx |
| 77 | + $ tools/configure.sh starpro64:nsh |
| 78 | + $ make |
| 79 | +
|
| 80 | +This produces the NuttX Kernel ``nuttx.bin``. Next, build the NuttX Apps Filesystem: |
| 81 | + |
| 82 | +.. code:: console |
| 83 | +
|
| 84 | + $ make export |
| 85 | + $ pushd ../apps |
| 86 | + $ tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz |
| 87 | + $ make import |
| 88 | + $ popd |
| 89 | + $ genromfs -f initrd -d ../apps/bin -V "NuttXBootVol" |
| 90 | +
|
| 91 | +This generates the Initial RAM Disk ``initrd``. |
| 92 | + |
| 93 | +Package the NuttX Kernel and Initial RAM Disk into a NuttX Image: |
| 94 | + |
| 95 | +.. code:: console |
| 96 | +
|
| 97 | + $ head -c 65536 /dev/zero >/tmp/nuttx.pad |
| 98 | + $ cat nuttx.bin /tmp/nuttx.pad initrd >Image-starpro64 |
| 99 | +
|
| 100 | +The NuttX Image ``Image-starpro64`` will be copied to the TFTP Server in the next step. |
| 101 | + |
| 102 | +Booting |
| 103 | +======= |
| 104 | + |
| 105 | +To boot NuttX on StarPro64, `install a TFTP Server <https://lupyuen.github.io/articles/starpro64#boot-nuttx-over-tftp>`_ |
| 106 | +on our computer. |
| 107 | + |
| 108 | +Copy the file ``Image-starpro64`` from the previous section to the TFTP Server, |
| 109 | +together with the Device Tree: |
| 110 | + |
| 111 | +.. code:: console |
| 112 | +
|
| 113 | + $ wget https://github.com/lupyuen/nuttx-starpro64/raw/refs/heads/main/eic7700-evb.dtb |
| 114 | + $ scp Image-starpro64 \ |
| 115 | + tftpserver:/tftpfolder/Image-starpro64 |
| 116 | + $ scp eic7700-evb.dtb \ |
| 117 | + tftpserver:/tftpfolder/eic7700-evb.dtb |
| 118 | +
|
| 119 | +Check that StarPro64 is connected to our computer via a USB Serial Adapter at 115.2 kbps: |
| 120 | + |
| 121 | +.. code:: console |
| 122 | +
|
| 123 | + $ screen /dev/ttyUSB0 115200 |
| 124 | +
|
| 125 | +When StarPro64 boots, press Ctrl-C until U-Boot stops. |
| 126 | +At the U-Boot Prompt, run these commands to |
| 127 | +`boot NuttX over TFTP <https://lupyuen.github.io/articles/starpro64#boot-nuttx-over-tftp>`_: |
| 128 | + |
| 129 | +.. code:: console |
| 130 | +
|
| 131 | + # Change to your TFTP Server |
| 132 | + $ setenv tftp_server 192.168.x.x |
| 133 | + $ saveenv |
| 134 | + $ dhcp ${kernel_addr_r} ${tftp_server}:Image-starpro64 |
| 135 | + $ tftpboot ${fdt_addr_r} ${tftp_server}:eic7700-evb.dtb |
| 136 | + $ fdt addr ${fdt_addr_r} |
| 137 | + $ booti ${kernel_addr_r} - ${fdt_addr_r} |
| 138 | +
|
| 139 | +Or configure U-Boot to `boot NuttX automatically <https://lupyuen.github.io/articles/starpro64#boot-nuttx-over-tftp>`_. |
| 140 | + |
| 141 | +NuttX boots on StarPro64 and NuttShell (nsh) appears in the Serial Console. |
| 142 | +To see the available commands in NuttShell: |
| 143 | + |
| 144 | +.. code:: console |
| 145 | +
|
| 146 | + $ help |
| 147 | +
|
| 148 | +Configurations |
| 149 | +============== |
| 150 | + |
| 151 | +nsh |
| 152 | +--- |
| 153 | + |
| 154 | +Basic configuration that runs NuttShell (nsh). |
| 155 | +This configuration is focused on low level, command-line driver testing. |
| 156 | +Built-in applications are supported, but none are enabled. |
| 157 | +Serial Console is enabled on UART0 at 115.2 kbps. |
| 158 | + |
| 159 | +Peripheral Support |
| 160 | +================== |
| 161 | + |
| 162 | +NuttX for StarPro64 supports these peripherals: |
| 163 | + |
| 164 | +======================== ======= ===== |
| 165 | +Peripheral Support NOTES |
| 166 | +======================== ======= ===== |
| 167 | +UART Yes |
| 168 | +======================== ======= ===== |
0 commit comments