Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contents of how to run autoware on NXP BlueBox3 platform. #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/version-1.0/start-guide/how-to-run-autoware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ This page explains how to run Autoware on the development platform that are set

## 1. Run Autoware on the developer platform

### Run Autoware.Auto on AVA platform or PCU
### Run Autoware.Auto on AVA platform, PCU or BlueBox 3.0

1. Open terminal window for each module on you host.

1. Access AVA platform or PCU via SSH in each terminal window.
2. Access AVA platform, PCU or BlueBox 3.0 via SSH in each terminal window.

1. Find docker image id.
3. Find docker image id.

```console
docker image ls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ Now you can see...
[DEMO Video](../../installation/images/run-autoware/scenario_e3b743e7-110c-4db6-b136-e5ffd5538315_2.mp4)

![DEMO](../../installation/images/run-autoware/demo.png)

[Demo on BlueBox 3.0](../../installation/images/run-autoware/Run_on_BlueBox3.0.mp4)
**NOTE**: According to the [limitations and issues](../limitations-and-issues/limitations-and-issues.md), the ego vehicle drives slowly. The demo video is x3 fast play.
150 changes: 150 additions & 0 deletions docs/version-1.0/start-guide/installation/getting-started-bb_3_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Getting started with BlueBox 3.0

## Overview

_Reference: BlueBox3.0_LinuxBSP_Quick_Start_Guide_

**The BlueBox 3.0 requires authorization for purchase based on the intended use. Support for BlueBox 3.0 projects will be provided exclusively through the dedicated NXP Community, which also requires authorization to view. Please contact support for further assistance.**

The NXP BlueBox development platform delivers the performance and functional safety features required to build zonal architectures, high-performance computing systems, analyze driving environments, assess risk factors and then direct the self-driving car's behavior.

[Autoware on BlueBox platform demo](https://www.youtube.com/watch?v=eI5JizQT8h0&t=321s)

This instruction explains how to boot up Ubuntu on BlueBox 3.0 and access it from host PC.

## Hardware Setup

### Default DIP switch settings

The table below provides default settings of dual inline package (DIP) switches available in BlueBox 3.0. For each DIP switch:

- If the switch is positioned toward the digit, the logical value is 0

- If the switch is positioned toward the "ON" marking, the logical value is 1

Table 1. Default DIP switch settings

| Switch | Settings (0: OFF, 1: ON) |
| :------: | :----------------------: |
| SW1[1:8] | 1111_1110 |
| SW2[1:8] | 0000_0101 |
| SW3[1:8] | 0000_1010 |

With the default DIP switch settings (mentioned in the table above):

- The LX2160A SoC boots from FlexSPI NOR flash memory

- The S32G274A SoC boots from SD card, following a factory configuration stored in the EEPROM

### Booting LX2160A from SD card

To make LX2160A to boot from SD card, set DIP switch SW1[1:4] settings as shown in the table below.and SD card should be plugged in.

Table 2. SD card specific switch settings for LX2160A

| Switch | Settings (0: OFF, 1: ON) |
| :------: | :----------------------: |
| SW1[1:4] | 1000 |

## Booting with provided binaries

BlueBox 3.0 comes with a factory-installed Linux image for the LX2160A SoC and a preimaged bootable micro-SD card for the S32G274A SoC, meaning that you should be able to start the unit out-of-the-box. In addition, the BlueBox 3.0 ADSDK software release provides full SD Card image for BlueBox3-LX2160A and BlueBox3-S32G274A device, including pre-installed applications from BB ADAS SDK running on Ubuntu 18.04. To boot the SoCs using the SD card images, perform the following steps:

1. Download the required files:

a. Download the SD card images from the BlueBox 3.0 ADSDK release location. You will find the following files:

- lx2160abluebox3ubuntu_sdcard_image_0.6.0.tar.gz
- s32g274abluebox3ubuntu_sdcard_image_0.6.0.tar.gz

2. Deploy the LX2160A and S32G274A standard images:

For this step, you need a micro-SD card and a card reader.

a. With the card inside, connect the card reader to your host Linux build machine. Ensure that it appears as a dedicated device inside the system.

**_NOTE: To accurately identify this device, compare the output of the following command before and after inserting themicro-SD card (this will show the newly created device and its existing partitions):_**

```
cat /proc/partitions
```

**_NOTE: If your Linux distribution auto-mounts inserted SD cards, you must unmount any mounted partitions before writing an image to the card._**

b. Write the LX2160A image (fsl-image-ubuntu-lx2160abluebox3.sdcard) directly onto the micro-SD card using the following command:

```
sudo dd if=fsl-image-ubuntu-lx2160abluebox3.sdcard of=<SD-card-node> bs=1M && sy
```

In the above command, \<SD-card-node\> is the device in use (for example, /dev/sdc).

**_NOTE: If you encounter issues when using dd, consider using a third-party alternative, such as Win32 Disk Imager (available on both Linux and Windows)._**

c. Insert the micro-SD card into the "LX2" SD port on BlueBox 3.0.

d. Connect the UART to a serial line on your host machine and open a terminal emulator (communications) program.

e. Make the appropriate DIP switch settings so that the LX2160A SoC boots directly from micro-SD card.

## Setup USB-UART connection on Host machine

1. USB to Quad-UART bridge driver needs to be installed on Windows hosts. On Linux host, the native USB to UART driver is used (usually /dev/ttyUSBxx).

Windows host setup:

- Download the FTDI driver from: <https://ftdichip.com/drivers/vcp-drivers/>
- Install the UART Driver on host
- Connect MicroUSB into the box for LX2/S32G UART connection
- Connect to the emulated serial ports (COM)

LX2 is first of the four displayed COM ports of LX2/S32G UART

S32G is third of the four displayed COM ports of LX2/S32G UART

- For COM port settings:

Bits per second: 115200

Data bits: 8

Parity: None

Stop bits: 1

Flow control: None

2. Power up BlueBox 3.0. You should see the LX2160A SoC booting (in the terminal emulator).

3. After the LX2160A SoC has booted, use the username _bluebox_ and password _bluebox_ to log in. At this point, you will have successfully written the complete LX2160A environment on BlueBox 3.0.

## Connect To BlueBox 3.0 via SSH

SSH connection is supported for LX2 and S32G Ubuntu system by default.
You could connect to BlueBox 3.0 via SSh either by ethernet.

1. Cable connection

Connect host PC to Eth port (Yellow) on BlueBox 3.0 board with Ethernet cable (GbE, need Cat.5e or above).

![BlueBox 3.0 enternet interfaces](images/getting-started-bb3/bluebox3_ethernet_interfaces.jpg)

2. Configure static IP for host PC
You need to manually configure IP for PC in order to connect with BlueBox 3.0. Here is DHCP client running on LX2/S32G by default after boot-up. Check interface IP address obtained from DHCP server via serial console. The host PC static IP should be different with BlueBox 3.0 and within the same network segment. (e.g. 192.168.1.200)

![Network Settings](images/getting-started-pcu/network-settings.png)

3. SSH login
For LX2:

```console
$ ssh bluebox@[IP from DHCP]
Password: bluebox
```

For S32G:

```
$ ssh bluebox@[IP from DHCP]
Password: bluebox
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
14 changes: 13 additions & 1 deletion docs/version-1.0/start-guide/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This page explains how to set up the development environment that are described
## Minimum requirements

- Developer Platform:
- [AVA Platform](https://www.ipi.wiki/pages/com-hpc-altra) or PCU Platform
- [AVA Platform](https://www.ipi.wiki/pages/com-hpc-altra), PCU Platform or [BlueBox 3.0](https://www.nxp.com/design/designs/bluebox-3-0-automotive-high-performance-compute-ahpc-development-platform:BlueBox)
- In-Vehicle Development Platform [^1]: TODO
- Software Tool:
- Scenario simulator version x.x [^2]
Expand Down Expand Up @@ -35,6 +35,10 @@ The setup procedure depends on the developer platform.

1. [Getting started with PCU](./getting-started-pcu.md)

### BlueBox 3.0 Platform

1. [Getting started with BlueBox 3.0](./getting-started-bb_3_0.md)

## 2. Set up the in-vehicle platform

!!! note "If you do NOT need a vehicle-edge platform, please skip this step."
Expand All @@ -51,6 +55,10 @@ TODO

1. [System setup on PCU](./system-setup-pcu.md)

### BlueBox 3.0 Platform

1. [System setup on BlueBox 3.0](./system-setup-bb_3_0.md)

## 4. Install Autoware container images on the in-vehicle platform

!!! note "If you do NOT need a vehicle-edge platform, please skip this step."
Expand All @@ -69,6 +77,10 @@ TODO

1. [System setup on your host](./system-setup-host.md)

### BlueBox 3.0 Platform

1. [System setup on your host](./system-setup-host.md)

## 6. Run Autoware on the development platform

Please refer to the [How to run Autoware](../how-to-run-autoware/index.md) section.
143 changes: 143 additions & 0 deletions docs/version-1.0/start-guide/installation/system-setup-bb_3_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# System Setup on BlueBox 3.0

## Overview

This instruction explans how to perform system setup for test execution on BlueBox 3.0.

The Docker Engine is installed in fsl-image-ubuntu image by default, only need to copy docker images and neccesary files to BlueBox 3.0.

## Access to BlueBox 3.0 via SSH

```console
ssh bluebox@IP-ADDRESS
```

For example;

```console
ssh bluebox@192.168.1.21
```

## Copy Autoware.Auto image to BlueBox 3.0

**NOTE**: docker should be initialized with post-installation steps. For instructions please refer to:

- [Post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall).

The docker image of Autoware.Auto is registered in [GitLab Container Registry](https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto/container_registry/2511358).
![GitLab Container Registry](images/system-setup-ava/gitlab-cr.png)

1. Copy docker image to BlueBox 3.0.

```console
docker pull registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/arm64/openadkit-foxy:latest
```

## Copy neccesary files to lcoal Downloads folder

1. Copy files related to **map contents**.

Files are placed in the directory :file_folder:[docs/Appendix/Open-AD-Kit-Start-Guide/map](map)

- :page_facing_up:[lanelet2_map.osm](map/kashiwanoha/lanelet2_map.osm)
- :page_facing_up:[pointcloud_map.pcd](map/kashiwanoha/pointcloud_map.pcd)
- :page_facing_up:[global_map_center.pcd.yaml](map/kashiwanoha/global_map_center.pcd.yaml)
- :page_facing_up:[lanelet2_map_provider.osm.yaml](map/kashiwanoha/lanelet2_map_provider.osm.yaml)
- :page_facing_up:[map.map_publisher.yaml](map/kashiwanoha/map.map_publisher.yaml)

Copy files to your local folder (Downloads folder as example) as the following directory structure.

![Local Map](images/system-setup-pcu/local_map.png)

1. Copy configuration file of **Cyclone DDS**.

In this test, we are using Cyclone DDS, so you also need to copy configuration file of Cyclone DDS.

File is placed in the directory :file_folder:[docs/Appendix/Open-AD-Kit-Start-Guide/cyclonedds](cyclonedds)

- :page_facing_up:[cyclonedds.xml](cyclonedds/cyclonedds.xml)

Copy the file to your local folder as the following directory structure.

![Local Cyclone DDS](images/system-setup-pcu/local_cyclonedds.png)

1. Copy **kernel configuration** file for tuning kernel parameters.

We have to reconfigure kernel parameters by using `sysctl` for system stability.

File is placed in the directory :file_folder:[docs/Appendix/Open-AD-Kit-Start-Guide/sysctl.d](sysctl.d)

- :page_facing_up:[60_cyclonedds.conf](sysctl.d/60_cyclonedds.conf)

Copy the file to your local folder.

## Copy files from local folder to BlueBox 3.0

1. Connect your host PC with BlueBox 3.0 through internet and copy files with SCP.

1. Access to BlueBox 3.0 via SSH

For example;

```console
ssh bluebox@192.168.1.21
```

1. Cpoy kernel configuration file to `/etc/sysctl.d/`

```console
sudo scp USER-NAME@IP-ADDRESS:/home/USER-NAME/Downloads/60_cyclonedds.conf /etc/sysctl.d/
```

For example;

```console
sudo scp username@192.168.1.23:/home/username/Downloads/60_cyclonedds.conf /etc/sysctl.d/
```

Then type in the password of BlueBox 3.0 (default password: bluebox) and host PC as request.

1. Update kernel parameters.

```console
sudo sysctl -p /etc/sysctl.d/60_cyclonedds.conf
```

1. Copy **map contents** files and **Cyclone DDS** configuration file.

```console
sudo scp -r USER-NAME@IP-ADDRESS:/home/username/Downloads/map ~/
```

```console
sudo scp -r USER-NAME@IP-ADDRESS:/home/username/Downloads/cyclonedds ~/
```

## Modify `cyclonedds.xml`

You need to change the element `NetworkInterfaceAddress` to the network interface currently in use.

1. Find network interface.

```console
ip addr
TODO add ip example list
```

:speech_balloon: You can find inetwork interface such as `eth1`.

1. Change the `NetworkInterfaceAddress`.

```console
sudo vi ~/cyclonedds/cyclonedds.xml
```

For example; :page_facing_up: cyclonedds.xml

```diff
<General>
- <NetworkInterfaceAddress>lo</NetworkInterfaceAddress>
+ <NetworkInterfaceAddress>eth1</NetworkInterfaceAddress>
</General>

```