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

doc: quickstart adjust for macOS #155

Merged
merged 1 commit into from
Dec 15, 2023
Merged
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
Binary file added quickstart/_images/imxrt106x-ls-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/imxrt106x-ls-mac2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/imxrt117x-ls-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/imxrt117x-ls-mac2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/stm32l4x6-ls-macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/stm32l4x6-ls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/zynq7000-ls-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/zynq7000-ls2-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 59 additions & 4 deletions quickstart/armv7a9-zynq7000-qemu.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See [how to build the Phoenix-RTOS system image](../building/README.md).
Firstly, you need to have the docker installed.

<details>
<summary>How to get docker (Ubuntu 20.04)</summary>
<summary>How to get docker (Ubuntu 22.04)</summary>

- Install required packages

Expand Down Expand Up @@ -77,6 +77,61 @@ Firstly, you need to have the docker installed.

</details>

<details>
<summary>How to get docker (macOS)</summary>

You can find the up-to-date instructions on <https://docs.docker.com/desktop/install/mac-install/>

To make this process simpler, below is an example of installation for Mac with the Intel chip:

Download the installer:

```bash
curl -o Docker.dmg "https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&amp;utm_medium=webreferral&amp;utm_campaign=docs-driven-download-mac-amd64"
```

Run the following commands to install Docker:

```bash
sudo hdiutil attach Docker.dmg && \
sudo /Volumes/Docker/Docker.app/Contents/MacOS/install && \
sudo hdiutil detach /Volumes/Docker
```

Then add the path to `docker` binaries to the `PATH` environment variable:

```bash
export PATH="/Applications/Docker.app/Contents/Resources/bin:$PATH"
```

It's recommended to place it in `.zshrc` startup script to export it every time during startup:

```bash
echo 'export PATH=/Applications/Docker.app/Contents/Resources/bin:$PATH' >> $HOME/.zshrc
```

- Check if Docker is properly installed by checking its version:

``` bash
docker --version
```

- Check if running docker images without sudo works properly:

``` bash
docker run hello-world
```

*If you see the following error: `ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.`
you can try to install `colima` and check once again:

```bash
brew install colima && \
colima start
```

</details>

Now, with docker installed you can run Phoenix-RTOS using the following command:

```bash
Expand All @@ -102,23 +157,23 @@ As a result, you should see `psh` (Phoenix-RTOS shell).

To get the available command list please type:

```bash
```plaintext
help
```

<img src="_images/zynq7000-emu-help.png" width="700px">

If you want to get the list of working processes please type:

```bash
```plaintext
ps
```

<img src="_images/zynq7000-emu-ps.png" width="700px">

To get the table of processes please type:

```bash
```plaintext
top
```

Expand Down
72 changes: 57 additions & 15 deletions quickstart/armv7a9-zynq7000-zedboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,55 @@ The onboard UART-USB converter is used here.

- Now you should verify, what USB device on your host-pc is connected with the `UART` (console). To check that run:

- On Ubuntu:

```bash
ls -l /dev/serial/by-id
```

<img src="_images/zynq7000-ls.png" width="700px">

- On macOS:
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved

```bash
ls -l /dev/tty.*
```

<img src="_images/zynq7000-ls-mac.png" width="700px">

If your output is like in the screenshot above, the console (`UART` in the evaluation board) is on the `ACM0` 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 ACM0)

```bash
picocom -b 115200 --imap lfcrlf /dev/ttyACM0
picocom -b 115200 --imap lfcrlf /dev/tty[port]
```

<details>
<summary>How to get picocom and run it without privileges (Ubuntu)</summary>
<details>

```bash
sudo apt-get update && \
sudo apt-get install picocom
```
<summary>How to get picocom and run it without privileges (Ubuntu 22.04)</summary>

To use picocom without sudo privileges run this command and then restart:
```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 <yourname>
```

</details>
</br>

<details>
<summary>How to get picocom (macOS)</summary>

```bash
sudo usermod -a -G tty <yourname>
brew update &&\
brew install picocom
```

</details>
Expand Down Expand Up @@ -140,28 +162,38 @@ Please wait until erasing is finished.
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:

```plaintext
- On Ubuntu:

```bash
ls -l /dev/serial/by-id
```

<img src="_images/zynq7000-ls-2.png" width="700px">

- On macOS:

```bash
ls -l /dev/tty.*
```

<img src="_images/zynq7000-ls2-mac.png" width="700px">

To share disk image to the bootloader, `phoenixd` has to be launched with the following arguments
(choose suitable ttyACMx device, in this case, ttyACM1):

```plaintext
```bash
cd _boot/armv7a9-zynq7000-zedboard
```

```plaintext
sudo ./phoenixd -p /dev/ttyACM1 -b 115200 -s .
```bash
sudo ./phoenixd -p /dev/tty[port] -b 115200 -s .
```

<img src="_images/zynq7000-phoenixd.png" width="700px">

To start copying the file, write the following command in the console with plo interface:

```plaintext
```bash
copy usb0 phoenix.disk flash0 0x0 0x0
```

Expand All @@ -186,16 +218,26 @@ To run it you should follow the steps below:

- Check which port the console appeared on:

- On Ubuntu:

```bash
ls -l /dev/serial/by-id/
```

<img src="_images/zynq7000-ls-3.png" width="700px">

- On macOS:
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved

```bash
ls -l /dev/tty.*
```

<img src="_images/zynq7000-ls-mac.png" width="700px">

- connect to that port:

```bash
picocom -b 115200 --imap lfcrlf /dev/ttyACM0
picocom -b 115200 --imap lfcrlf /dev/tty[port]
```

- restart the chip using the `PS-RST` button to print initialization logs:
Expand Down
83 changes: 74 additions & 9 deletions quickstart/armv7m4-stm32l4x6-nucleo.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,84 @@ To communicate with the board you will need to use a UART-USB converter, like `P

<img src="_images/stm32l4x6-connections.png" width="400px">

- Now you should verify, what USB device on your host-pc is connected with the `UART` (console). To check that run:

- On Ubuntu:

mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
```bash
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
ls -l /dev/serial/by-id
```

<img src="_images/stm32l4x6-ls.png" width="700px">

- On macOS:

```bash
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
ls -l /dev/tty.*
```

<img src="_images/stm32l4x6-ls-macos.png" width="700px">

- Open serial port in terminal using picocom

```bash
picocom -b 115200 --imap lfcrlf /dev/ttyUSB0
picocom -b 115200 --imap lfcrlf /dev/tty[port]
```

<details>
<summary>How to get picocom (Ubuntu 20.04)</summary>
<summary>How to get picocom and run it without privileges (Ubuntu 22.04)</summary>

```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 <yourname>
```

</details>

<details>
<summary>How to get picocom (macOS)</summary>

```bash
brew update &&\
brew install picocom
```

</details>
</br>

You can leave the terminal with the serial port open, and follow the next steps.

## Flashing the Phoenix-RTOS system image

To flash the image to the board you will need `openocd` in version 0.11. When installing openocd using `apt-get` version
can be out of date (0.10). You can check it using
To flash the image to the board you will need `openocd` in version 0.11 or 0.12. You can check it using

```bash
openocd -v
```

<details>
<summary>How to get openocd in version 0.11 (Ubuntu 20.04)</summary>
<summary>How to get openocd in version 0.11 (Ubuntu 22.04)</summary>

To install from the default repositoriy:

- use `apt-get`

```bash
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
sudo apt-get install openocd
```

- check if the version is correct

```bash
openocd -v
```

To install manually:

- download `openocd-0.11.0-rc2` from [here](https://launchpad.net/ubuntu/+source/openocd)
- enter the downloaded directory
Expand All @@ -88,12 +136,29 @@ openocd -v
openocd -v
```

</br>
<img src="_images/openocd-version.png" width="700px">
</br>

</details>

<details>
<summary>How to get openocd (macOS) </summary>
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved

- install openocd
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved

```bash
brew update &&\
brew install open-ocd
```

- check if the version is correct
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved
mateusz-bloch marked this conversation as resolved.
Show resolved Hide resolved

```bash
openocd -v
```

</details>
</br>

If you have openocd, next you can use the following script:

```bash
Expand Down Expand Up @@ -132,7 +197,7 @@ help

To get the list of working processes please type:

```bash
```plaintext
ps
```

Expand Down
Loading